BPMN Diagram
<bpmn:process id="Process_1" name="Sample Process" isExecutable="true" camunda:versionTag="1.0">
<bpmn:startEvent id="StartEvent_1" />
</bpmn:process>
SIc duket nga kodi kemi nje proces me :
id= Process_1
name= Sample Proces
Brenda te cilit kemi vendosir nje startEvent me id="StartEvent_1"
.
<bpmn:process id="Process_1" name="Sample Process" isExecutable="true" camunda:versionTag="1.0">
<bpmn:startEvent id="StartEvent_1">
<bpmn:outgoing>SequenceFlow_1</bpmn:outgoing>
</bpmn:startEvent>
<bpmn:task id="Task_1" name="GetApplication">
<bpmn:incoming>SequenceFlow_1</bpmn:incoming>
</bpmn:task>
<bpmn:sequenceFlow id="SequenceFlow_1" name="GoToGetApplication" sourceRef="StartEvent_1" targetRef="Task_1" />
</bpmn:process>
Eshte e mundur te kemi dy startEvent, pasi mund te kete disa evente qe mund te generojne inicimin e nje instance te procesit.
Kodi me poshte ilustron kete rast
<bpmn:process id="Process_1" name="Sample Process" isExecutable="true" camunda:versionTag="1.0">
<bpmn:startEvent id="StartEvent_1">
<bpmn:outgoing>SequenceFlow_1</bpmn:outgoing>
</bpmn:startEvent>
<bpmn:task id="Task_1" name="GetApplication">
<bpmn:incoming>SequenceFlow_1</bpmn:incoming>
<bpmn:incoming>SequenceFlow_2</bpmn:incoming>
</bpmn:task>
<bpmn:sequenceFlow id="SequenceFlow_1" name="GoToGetApplication" sourceRef="StartEvent_1" targetRef="Task_1" />
<bpmn:startEvent id="StartEvent_2">
<bpmn:outgoing>SequenceFlow_2</bpmn:outgoing>
</bpmn:startEvent>
<bpmn:sequenceFlow id="SequenceFlow_2" sourceRef="StartEvent_2" targetRef="Task_1" />
</bpmn:process>
Ndersa diagrama paraqet kete rast:
Proceset e marra ne shembull deri tani nuk kane pjesemarres, Process Partecipants ose Process Roles.
Keto ne vizualizim perfaqesohen nepemjet Lanes.
Shembulli me poshte ilustron nje proces me 1 pjesemarres
Kodi xml i procesit me lart
<bpmn:collaboration id="Collaboration_1ph8f12">
<bpmn:participant id="Participant_0w3j3la" processRef="Process_1" />
</bpmn:collaboration>
<bpmn:process id="Process_1" name="Sample Process" isExecutable="true" camunda:versionTag="1.0">
<bpmn:task id="Task_1" name="GetApplication">
<bpmn:incoming>SequenceFlow_1</bpmn:incoming>
<bpmn:incoming>SequenceFlow_2</bpmn:incoming>
</bpmn:task>
<bpmn:startEvent id="StartEvent_1">
<bpmn:outgoing>SequenceFlow_1</bpmn:outgoing>
</bpmn:startEvent>
<bpmn:startEvent id="StartEvent_2">
<bpmn:outgoing>SequenceFlow_2</bpmn:outgoing>
</bpmn:startEvent>
<bpmn:sequenceFlow id="SequenceFlow_1" name="GoToGetApplication" sourceRef="StartEvent_1" targetRef="Task_1" />
<bpmn:sequenceFlow id="SequenceFlow_2" sourceRef="StartEvent_2" targetRef="Task_1" />
</bpmn:process>
Sic duke nga kodi me lart shtohet nje element bpmn:collaboration.
Tagu bpmn:collaboration percakton listen e pjesemarresve "Partecipants", nepermjet elementeve bij te tij partecipant.
Cdonjeri nga pjesemarresit ka nje proces reference.
Nje partecipant mund te ndahet ne me shume lane. Lane nuk percaktojne procese shtese, pra i referohen te njejtit pjesemarres por me shtresa te ndryshme.
Shembulli me poshte ilustron rastin e nje procesi me nje pjesemarres i ndare ne dy lane.
Kodi xml i procesit me lart eshte:
<bpmn:collaboration id="Collaboration_1ph8f12">
<bpmn:participant id="ZShQ" name="Zyra e Sherbimit te Qytetarit" processRef="Process_1" />
</bpmn:collaboration>
<bpmn:process id="Process_1" name="Sample Process" isExecutable="true" camunda:versionTag="1.0">
<bpmn:laneSet id="LaneSet_0evjni6">
<bpmn:lane id="Lane_1" name="Pritja e qytetareve">
<bpmn:flowNodeRef>StartEvent_1</bpmn:flowNodeRef>
</bpmn:lane>
<bpmn:lane id="Lane_2" name="Pranimi i dokumentave">
<bpmn:flowNodeRef>StartEvent_2</bpmn:flowNodeRef>
<bpmn:flowNodeRef>Task_1</bpmn:flowNodeRef>
</bpmn:lane>
</bpmn:laneSet>
<bpmn:startEvent id="StartEvent_2">
<bpmn:outgoing>SequenceFlow_2</bpmn:outgoing>
</bpmn:startEvent>
<bpmn:sequenceFlow id="SequenceFlow_1" name="GoToGetApplication" sourceRef="StartEvent_1" targetRef="Task_1" />
<bpmn:sequenceFlow id="SequenceFlow_2" sourceRef="StartEvent_2" targetRef="Task_1" />
<bpmn:startEvent id="StartEvent_1">
<bpmn:outgoing>SequenceFlow_1</bpmn:outgoing>
</bpmn:startEvent>
<bpmn:task id="Task_1" name="GetApplication">
<bpmn:incoming>SequenceFlow_1</bpmn:incoming>
<bpmn:incoming>SequenceFlow_2</bpmn:incoming>
</bpmn:task>
</bpmn:process>
Sic duket nga kodi me part krijojet nje lane set me dy lane por me te njejtin pjesemarres.
Ndersa do te shikojme rastin kur kemi dy partecipants ne proces. Ky rast ilustrohet nga shembullim me poshte:
Ne kete rast me shtimin e nje pjesemarresi, shtohet edhe nje proces qe i referohet atij pjesemarresi. Kjo gje evidentohet lehtesisht nga kodi xml i modelit te procesit me poshte:
<bpmn:collaboration id="Collaboration_1ph8f12">
<bpmn:participant id="ZShQ" name="Zyra e Sherbimit te Qytetarit" processRef="Process_1" />
<bpmn:participant id="Participant_2" name="Zyra Perpunuese" processRef="Process_2" />
<bpmn:messageFlow id="MessageFlow_14gr23u" sourceRef="Task_1" targetRef="Task_087sqbt" />
</bpmn:collaboration>
<bpmn:process id="Process_1" name="Sample Process" isExecutable="true" camunda:versionTag="1.0">
<bpmn:laneSet id="LaneSet_0evjni6">
<bpmn:lane id="Lane_1" name="Pritja e qytetareve">
<bpmn:flowNodeRef>StartEvent_1</bpmn:flowNodeRef>
</bpmn:lane>
<bpmn:lane id="Lane_2" name="Pranimi i dokumentave">
<bpmn:flowNodeRef>StartEvent_2</bpmn:flowNodeRef>
<bpmn:flowNodeRef>Task_1</bpmn:flowNodeRef>
</bpmn:lane>
</bpmn:laneSet>
<bpmn:startEvent id="StartEvent_2">
<bpmn:outgoing>SequenceFlow_2</bpmn:outgoing>
</bpmn:startEvent>
<bpmn:sequenceFlow id="SequenceFlow_1" name="GoToGetApplication" sourceRef="StartEvent_1" targetRef="Task_1" />
<bpmn:sequenceFlow id="SequenceFlow_2" sourceRef="StartEvent_2" targetRef="Task_1" />
<bpmn:startEvent id="StartEvent_1">
<bpmn:outgoing>SequenceFlow_1</bpmn:outgoing>
</bpmn:startEvent>
<bpmn:task id="Task_1" name="GetApplication">
<bpmn:incoming>SequenceFlow_1</bpmn:incoming>
<bpmn:incoming>SequenceFlow_2</bpmn:incoming>
</bpmn:task>
</bpmn:process>
<bpmn:process id="Process_2" name="Perpunimi kesesi ker" isExecutable="false">
<bpmn:task id="Task_087sqbt" name="Trajto kerkesen" />
</bpmn:process>
Sic duket edhe nga kodi me lart, eshte shtuar nje partecipant i ri nen tagun collaboration qe eshte zyra perpunuese, gjithashtu eshte shtuar edhe nje message flow nga pjesemarresi1 tek pjesemarresi 2.
Mesazhi ka source dhe target perkatesisht task tek procesi 1 qe ka te beje me pjesemarresin 1 dhe task 2 te procesit 2 qe ka te beje me pjesemarresin 1.
Pra workflow i cdo pjesemarresi modelohet si proces me vehte qe ndervepron me proceset e pjesemarresve te tjere.
Kodi xml i shembullit me lart
<bpmn:collaboration id="Collaboration_3">
<bpmn:participant id="ZShQ" name="Zyra e Sherbimit te Qytetarit" processRef="Process_1" />
<bpmn:participant id="Participant_2" name="Zyra Perpunuese" processRef="Process_2" />
<bpmn:participant id="Participant_1adh07s" />
<bpmn:messageFlow id="MessageFlow_14gr23u" sourceRef="Task_1" targetRef="Task_087sqbt" />
<bpmn:messageFlow id="MessageFlow_16p23gb" sourceRef="Task_087sqbt" targetRef="Participant_1adh07s" />
<bpmn:messageFlow id="MessageFlow_0rb1ary" sourceRef="Participant_1adh07s" targetRef="Task_0wvjwvx" />
</bpmn:collaboration>
<bpmn:process id="Process_1" name="Sample Process" isExecutable="true" camunda:versionTag="1.0">
<bpmn:laneSet id="LaneSet_0evjni6">
<bpmn:lane id="Lane_1" name="Pritja e qytetareve">
<bpmn:flowNodeRef>StartEvent_1</bpmn:flowNodeRef>
</bpmn:lane>
<bpmn:lane id="Lane_2" name="Pranimi i dokumentave">
<bpmn:flowNodeRef>Task_1</bpmn:flowNodeRef>
<bpmn:flowNodeRef>StartEvent_2</bpmn:flowNodeRef>
</bpmn:lane>
<bpmn:lane id="Lane_16aazu3">
<bpmn:flowNodeRef>Task_1</bpmn:flowNodeRef>
</bpmn:lane>
<bpmn:lane id="Lane_14igtf9">
<bpmn:flowNodeRef>StartEvent_2</bpmn:flowNodeRef>
</bpmn:lane>
<bpmn:lane id="Lane_2_1" name="Skanimi i Dpsjeve">
<bpmn:flowNodeRef>Task_1</bpmn:flowNodeRef>
</bpmn:lane>
<bpmn:lane id="Lane_2_2" name="Trajtimi">
<bpmn:flowNodeRef>StartEvent_2</bpmn:flowNodeRef>
</bpmn:lane>
</bpmn:laneSet>
<bpmn:sequenceFlow id="SequenceFlow_1" name="GoToGetApplication" sourceRef="StartEvent_1" targetRef="Task_1" />
<bpmn:sequenceFlow id="SequenceFlow_2" sourceRef="StartEvent_2" targetRef="Task_1" />
<bpmn:startEvent id="StartEvent_1">
<bpmn:outgoing>SequenceFlow_1</bpmn:outgoing>
</bpmn:startEvent>
<bpmn:task id="Task_1" name="GetApplication">
<bpmn:incoming>SequenceFlow_1</bpmn:incoming>
<bpmn:incoming>SequenceFlow_2</bpmn:incoming>
</bpmn:task>
<bpmn:startEvent id="StartEvent_2">
<bpmn:outgoing>SequenceFlow_2</bpmn:outgoing>
</bpmn:startEvent>
</bpmn:process>
<bpmn:process id="Process_2" name="Perpunimi kesesi ker" isExecutable="false">
<bpmn:task id="Task_087sqbt" name="Trajto kerkesen" />
<bpmn:endEvent id="EndEvent_0vgg96m">
<bpmn:incoming>SequenceFlow_112rlix</bpmn:incoming>
</bpmn:endEvent>
<bpmn:task id="Task_0wvjwvx">
<bpmn:outgoing>SequenceFlow_112rlix</bpmn:outgoing>
</bpmn:task>
<bpmn:sequenceFlow id="SequenceFlow_112rlix" sourceRef="Task_0wvjwvx" targetRef="EndEvent_0vgg96m" />
</bpmn:process>
A collaboration diagram analyzes the sequence flow of processes and the exchange of messages between participants (represented as swimlanes and pools). Each pool contains an implicit process with a start event and one or more end events. A process diagram analyzes the sequence flow in a single process in a participant (which can be shown or implicit).
In the following example collaboration diagram, the interactions between the staff of a pizza restaurant and a customer are analyzed:
The following tools are available in collaboration and process diagrams:
Tool
Description
Start Events - Initiate a process (see Events (BPMN)). The various types of start events each have their own tools.
Intermediate Events - Trigger further activity during a process (see Events (BPMN)). The various types of intermediate events each have their own tools.
End Events - Conclude a process (see Events (BPMN)). The various types of end events each have their own tools.
Activities - Work performed within a process (see Activities (BPMN)). The various types of activities each have their own tools.
Participant - Organization, business unit, or role represented as swimlanes and pools (see Participants (BPMN)).
Gateways - Merge or split the sequence flow (see Gateways (BPMN)). The various types of gateways each have their own tools.
Data Objects - Information item used in a process (see Data (BPMN)). The various types of data objects each have their own tools.
Message Flow - Links a participant to another participant and passes a message between them. You can also draw message flows from an activity contained within a participant to another participant or to one of its activities (see Flows and Links (BPMN)).
Sequence Flow - Links two elements (events, activities, gateways) in a process (see Flows and Links (BPMN)).
Data Association - Links a data object to an activity or event (see Flows and Links (BPMN)).
...
...
...
...
...
...
An event is something that happens during the course of a process. Events include the start and end of an activity, and any other intermediate happening (such as a change of state or receipt of a message) which will affect its sequence or timing. You can create events in collaboration, process, and choreography diagrams.
The following types of events are available:
None - Untyped events, which indicate start points, state changes, and final states.
Message - Receiving and sending messages.
Timer - Cyclic timer events, points in time, time spans, or timeouts.
Escalation - Escalating to a higher level of responsibility.
Conditional - Reacting to changed business conditions or integrating business rules.
Link - Off-page connectors. Two corresponding link events equal a sequence flow.
Error - Catching or throwing named errors.
Cancel - Reacting to cancelled transactions or triggering cancellation.
Compensation - Handling or triggering compensation.
Signal - Signalling across different processes. A signal thrown can be caught multiple times.
Multiple - Catching one out of a set of events. Throwing all events defined.
Parallel multiple - Catching all out of a set of parallel events.
Terminate - Triggering the immediate termination of a process.
Gateways control the sequence flow of the process, and can merge or split the flow as dictated by the gateway conditions. You can create gateways in collaboration, process, and choreography diagrams.
The following kinds of gateways are available:
Symbol
Description
Basic/Exclusive gateway - When splitting, routes the flow to one outgoing branch. When merging, waits for one incoming branch to complete before triggering the outgoing flow.
Parallel gateway - When splitting, activates all outgoing branches simultaneously. When merging, waits for all incoming branches to complete.
Inclusive gateway - When splitting, activates one or more branches. When merging, waits for all incoming branches to complete before merging.
Event-based gateway - Followed by catching events or receive tasks and routes the flow to whichever of these happens first.
Exclusive event-based gateway - Starts a new process instance for each occurrence of a subsequent event.
Parallel event-based gateway - Starts a new process instance for the occurrence of all subsequent events.
Complex gateway - Treats complex merging or branching behavior not covered by other gateways.
Activities are work that is performed within a process. You can create activities in collaboration and process diagrams.
The following types of activities are available:
Symbol
Description
Abstract task - Basic unit of work.
Send task - Sends a message to a participant external to the process. Once the message has been sent, the task is completed.
Receive task - Waits for a message to arrive from a participant external to the process. Once the message has been received, the task is completed.
User task - A human performer performs the task with the assistance of a software application and is scheduled through a task list manager of some sort.
Manual task - A task that is performed without the aid of any business process execution engine or any application. For example, a telephone technician installing a telephone at a customer location.
Business rule task - Sends input to a business rules engine and receives the output of the engine's calculations.
Service task - Uses a Web service or automated application.
Script task - Executed by a script interpreted by a business process engine.
Transaction - Set of activities that logically belong together, and which might follow a specific transaction protocol.
Call activity - Wrapper for a globally defined sub-process or task that is reused in the current process.
Sub-process - An activity whose internal details have been modeled using activities, gateways, events, and sequence flows.
Event sub-process - Placed into a process or sub-process and is activated when its start event is triggered, and can interrupt the higher level process context or run in parallel (non-interrupting) depending on the start event.
Ad hoc sub-process - A specialized type of sub-process that is a group of activities that have no required sequence relationships, and whose sequence and number are determined by the performers of the activities.
Data are physical or information items that are created, manipulated, or otherwise used during the execution of a process. You can create data objects in collaboration and process diagrams.
Note: Is not support the association of data objects with sequence flows.
The following kinds of data are available:
Symbol
Description
Data object - Information flowing through the process.
Data input - External input for the entire process, which can be read by an activity.
Data output - Variable available as the result of the entire process.
Collection data object - Collection of information, such as a list of order items.
Collection data input
Collection data output
Data store - Place where the process can read or write data, such as a database or filing cabinet, and which persists beyond the lifetime of the process instance.
A message represents the content of a communication between two participants, and is passed along a message flow. In choreography diagrams, an initiating message is automatically colored white, and a non-initiating message is automatically colored grey.
Messages are based upon and share the same properties as standard BPM message formats.
BPMN provides various kinds of flows and links to connect objects in collaboration, conversation, and choreography diagrams.
The following types of flows and links are available:
Tool
Description
Sequence Flow - Connects events, activities, and gateways in processes in collaboration, process, and choreography diagrams.
Message Flow - Connects participants in collaboration diagrams. Connects message symbols to participant bands on choreography tasks in choreography diagrams.
Data Association - Connects data objects to activities or events in collaboration and process diagrams (see Resource Flows (BPM)).
Conversation Link - Connects participants in conversation diagrams.
Sequence and Message Flows are based on and have the same properties as standard flows (see Flow Properties). Message flows have the following additional properties:
Property
Correlation key
Correlation property
Description
Specifies the correlation key (set of correlation properties drawn from the message) used to associate the message to a particular instance of a process (see Correlation Keys (BPM)). Each flow must have the same key as the conversation node to which it is connected.
Specifies the correlation property that acts as the unique identifier for this instance of the message (see Variables (BPM)).