Contents
- Event
- BPMN event trigger
Having trouble getting help?
Contact Support
Contact Support
BPMN Event in EJ2 TypeScript Diagram control
15 Dec 202415 minutes to read
Event
An event
is a common BPMN process model element that represents something that happens during a business process and is notated with a circle. The type of events are as follows:
* Start
* Intermediate
* NonInterruptingStart
* NonInterruptingIntermediate
* ThrowingIntermediate
* End
The event
property of the node allows you to define the type of the event. The default value of the event is start. The following code example illustrates how to create a BPMN event.
import { Diagram, NodeModel, BpmnShape, BpmnSubProcessModel, BpmnDiagrams, BpmnActivityModel, BpmnFlowModel } from '@syncfusion/ej2-diagrams';
Diagram.Inject(BpmnDiagrams);
// A node is created and stored in nodes array.
let nodes: NodeModel[] = [
{
// Position of the node
offsetX: 150,
offsetY: 150,
// Size of the node
width: 100,
height: 100,
//Sets type as Bpmn and shape as event
shape: {
type: 'Bpmn',
shape: 'Event',
// Sets event as Start and trigger as None
event: {
event: 'Start',
trigger: 'None',
},
},
},
{
// Position of the node
offsetX: 350,
offsetY: 150,
// Size of the node
width: 100,
height: 100,
//Sets type as Bpmn and shape as event
shape: {
type: 'Bpmn',
shape: 'Event',
// Sets event as Intermediate and trigger as None
event: {
event: 'Intermediate',
trigger: 'None',
},
},
},
{
// Position of the node
offsetX: 550,
offsetY: 150,
// Size of the node
width: 100,
height: 100,
//Sets type as Bpmn and shape as event
shape: {
type: 'Bpmn',
shape: 'Event',
// Sets event as End and trigger as None
event: {
event: 'End',
trigger: 'None',
},
},
},
{
// Position of the node
offsetX: 150,
offsetY: 350,
// Size of the node
width: 100,
height: 100,
//Sets type as Bpmn and shape as event
shape: {
type: 'Bpmn',
shape: 'Event',
// Sets event as NonInterruptingStart and trigger as Timer
event: {
event: 'NonInterruptingStart',
trigger: 'Timer',
},
},
},
{
// Position of the node
offsetX: 350,
offsetY: 350,
// Size of the node
width: 100,
height: 100,
//Sets type as Bpmn and shape as event
shape: {
type: 'Bpmn',
shape: 'Event',
// Sets event as NonInterruptingIntermediate and trigger as Escalation
event: {
event: 'NonInterruptingIntermediate',
trigger: 'Escalation',
},
},
},
{
// Position of the node
offsetX: 550,
offsetY: 350,
// Size of the node
width: 100,
height: 100,
//Sets type as Bpmn and shape as event
shape: {
type: 'Bpmn',
shape: 'Event',
// Sets event as ThrowingIntermediate and trigger as Compensation
event: {
event: 'ThrowingIntermediate',
trigger: 'Compensation',
},
},
},
];
// initialize diagram component
let diagram: Diagram = new Diagram({
width: '100%',
height: '600px',
// Add node
nodes: nodes
});
// render initialized diagram
diagram.appendTo('#element');
<!DOCTYPE html>
<html lang="en">
<head>
<title>EJ2 Diagram</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="Typescript UI Controls" />
<meta name="author" content="Syncfusion" />
<link href="index.css" rel="stylesheet" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.38/system.js"></script>
<link href="https://cdn.syncfusion.com/ej2/28.2.3/ej2-base/styles/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/28.2.3/ej2-buttons/styles/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/28.2.3/ej2-popups/styles/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/28.2.3/ej2-splitbuttons/styles/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/28.2.3/ej2-diagrams/styles/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/28.2.3/ej2-navigations/styles/fabric.css" rel="stylesheet" />
<script src="systemjs.config.js"></script>
<script src="https://cdn.syncfusion.com/ej2/syncfusion-helper.js" type ="text/javascript"></script>
</head>
<body>
<div id='loader'>Loading....</div>
<div id='container'>
<div id='element'></div>
</div>
</body>
</html>
BPMN event trigger
Event triggers are notated as icons inside the circle and they represent the specific details of the process. The trigger
property of the node allows you to set the type of trigger and by default, it is set as none. The following table illustrates the type of event triggers.
Triggers | Start | Non-Interrupting Start | Intermediate | Non-Interrupting Intermediate | Throwing Intermediate | End |
---|---|---|---|---|---|---|
None | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Message | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Timer | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Conditional | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Link | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Signal | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Error | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Escalation | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Termination | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Compensation | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Cancel | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Multiple | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Parallel | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |