Monday, March 15, 2021

Boundary Event, BPMN, Flowable, Intermediate Event, Boundary Event, Cancel Boundary Event, Compensation Boundary Event




Event Icons are always Circular

Throwing Events -> Triggering something
Catching Events -> Reacting to a Trigger : Catching Message Event

Types of Event
Events that occur at the beginning of the process are called Start events(thin narrow line) – and every process starts with an event.
Events that occur in the middle of the process (between activities) are called Intermediate events (thin double line).
Events that occur at the end of the process are called End events(thick single line) and every process has at least one end event.

Boundary Events -> Are Attached to Tasks(Rounded Rectangle) and is always an Intermediate Event
They can be Interrupting and Non-Interrupting
Interrupting - They disturb flow and block main process - Solid Line (Default)
Non-Interrupting - They don't disturb the actual flow and continue in parallel - Dashed Line

An intermediate signal throw event is visualized as a typical intermediate event (circle with smaller circle inside), with the signal icon inside. 
The signal icon is black (filled), to indicate its throw semantics.

Cancel Boundary Event
Compensation Boundary Event

The compensation boundary event is activated when the activity it is attached to completes successfully. 
At this point, the corresponding subscription to the compensation events is created. 
The subscription is removed either when a compensation event is triggered or when the corresponding process instance ends.


Sunday, March 14, 2021

DTU - Database Transaction Unit

https://www.spotlightcloud.io/blog/what-is-dtu-in-azure-sql-database-and-how-much-do-we-need



DTU represents a mixture of the following performance metrics as a single performance unit for Azure SQL Database:

  • CPU
  • Memory
  • Data I/O and Log I/O

Output Clause - MSSQL - INSERTED, DELETED - Microsoft Azure Database

https://docs.microsoft.com/en-us/sql/t-sql/queries/output-clause-transact-sql?view=sql-server-ver15

https://www.sqlbook.com/sql-server/output-clause/

https://blog.sqlauthority.com/2017/06/29/sql-server-get-column-names-specific-table/

https://docs.microsoft.com/en-us/azure/architecture/patterns/compensating-transaction

-- Insert 3 rows of data into this table and use the OUTPUT
-- clause to return all of the columns for each row we insert
INSERT INTO Organisation
OUTPUT [Inserted].*
VALUES ('Super Co.', 'USA'),
('Great Co.', 'UK'),
('Fab Co.', 'India');


INSERT TABLE-1 VALUES (“X”, “Y”)
UPDATE TABLE-2 SET COLUMN-2A=”New-A”, COLUMN-2B=”New-B” WHERE COLUMN-2C=”value-C”
DELETE TABLE-3 WHERE COLUMN-3A=”Val1” AND COLUMN-3G=”Val2”

INSERT TABLE-1
OUTPUT INSERTED.* INTO @Table1-Var -- Table1-Var will have rows inserted along with their IDs
VALUES (“X”, “Y”)

UPDATE TABLE-2 SET COLUMN-2A=”New-A”, COLUMN-2B=”New-B” WHERE COLUMN-2C=”value-C”
OUTPUT DELETED.* INTO @Table2-Var -- All updated rows with old values and IDs

DELETE TABLE-3 
OUTPUT DELETED.* INTO @Table3-Var -- All deleted rows with IDs
WHERE COLUMN-3A=”Val1” AND COLUMN-3G=”Val2”


-- Record compensating transaction for INSERT using 
record-compensating-txn(<process-instanceId>, <process-block-id>, “TABLE-1”, “DELETE”, @Table1-Var)

-- Record compensating transaction for UPDATE using 
record-compensating-txn(<process-instanceId>, <process-block-id>, “TABLE-2”, “UPDATE”, @Table2-Var)

-- Record compensating transaction for DELETE using 
record-compensating-txn(<process-instanceId>, <process-block-id>, “TABLE-3”,  “INSERT”, @Table3-Var)

Thursday, March 11, 2021

Aggregate Pipelines Mongodb


db.purchase_orders.aggegate(
	[
		{$match : {customer : {$in : ["Mike", "Karen"]}}}
		{$group : {
			_id: "$product",
			total:{$sum : "$total"}
			}
		}
		{$sort  : {total : -1}}
	]
)

Fonts, Web Safe Fonts, Web Open Font Format

Web Safe Fonts 
Arial, Courier New, Times New Roman, and Verdana are common web safe fonts.
These are available on All Machines.

https://blogpros.com/blog/2018/10/add-custom-fonts-blog 
Throughout the years, there have been a few workarounds to get fonts to display. Some old websites would use scripts that tried to get the user to download a font to use to display the site correctly, but this is incredibly dangerous. 

Web Fonts - WOFF - Web Open Font Format
Then, in 2010, the Mozilla Foundation, Microsoft, and Opera banded together to get the W3C to support the WOFF format. WOFF, or Web Open Font Format, supports a number of fonts and works in that same old method, simply downloading and using the font in the background. However, because it’s a limited and verifiable format, it’s not exploitable by malware.



Whats Cloud Native

 “Cloud native computing uses an open source software stack to be:

  1. Containerized. Each part (applications, processes, etc) is packaged in its own container. This facilitates reproducibility, transparency, and resource isolation.
  2. Dynamically orchestrated. Containers are actively scheduled and managed to optimize resource utilization.
  3. Microservices-oriented. Applications are segmented into microservices. This significantly increases the overall agility and maintainability of applications.”

“An approach that builds software applications as microservices and runs them on a containerized and dynamically orchestrated platform to utilize the advantages of the cloud computing model.”

POC - Microservices - Java Spring Cloud

Microservices POC 

--------------------------------------------------------------------------------------------------------------------





Spring Cloud Gateway


To run your own gateway use the spring-cloud-starter-gateway dependency.


Hystrix - org.springframework.cloud:spring-cloud-starter-netflix-hystrix

Circuit Breaker Pattern

Spring Boot vs Spring Cloud




Azure - Pipeline - Add Approver for Stage

https://learn.microsoft.com/en-us/azure/devops/pipelines/process/approvals?view=azure-devops&tabs=check-pass