User Tools

Site Tools


docs:bpwiki-tutorial

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

docs:bpwiki-tutorial [2017/09/19 16:31] (current)
Line 1: Line 1:
 +====== BPwiki Tutorial ======
  
 +SimpleBPMN is a plugin for DokuWiki - in order to work with it you have to have it installed. You can download it from [[downloads:​start##​bpwiki|downloads]] page.
 +
 +**SimpleBPMN Notation**
 +
 +SimpleBPMN is a JSON based notation focusing on the Process Diagrams. Since BPMN has more types of sub-models, SimpleBPMN covers only some elements that is offered by BPMN itself.
 +
 +In this tutorial, you will get to know how to prepare BP models using SimpleBPMN plugin. Let's start!
 +
 +If you need a quick introduction to Business Process, see [[docs:​bpwiki-about|this page]].
 +
 +
 +===== Structure of SimpleBPMN =====
 +
 +The SimpleBPMN notation is case-sensitive. The whole code on the Wiki page should be between ''<​bpmn>''​ ''</​bpmn>''​ tags. Inside tags Process is defined between braces {}. The whole Process can have (optionally) name (first specified thing after opening brace); afterwards there are definitions of all the objects in process.
 +
 +General rules:  ​
 +  * after identifier of object or after particular attribute of object there is colon (:)
 +  * after object id with colon there are (usually) braces ({}) inside which are defined attributes of object
 +  * after each object/​attribute at the same level (eg. attributes of the same object) there is comma (,)
 +  * names of objects/​attributes are written in quotes (""​)
 +  * in case of flow instead of braces there are brackets ([])
 +  * comments after two slashes
 +  * each object has to have identifier and can have optional parameters
 +
 +Rules in practice:
 +
 +<​code>​
 +{  //opening braces
 +
 + name: "​Process 1", //optional name
 + events:{
 +         ...
 + },
 + activities:​{
 + ...
 + },
 + gates:{
 + ...
 + },
 + flow:{
 + ...
 + }
 +} //closing braces
 +
 +</​code>​
 +
 +**Additional tag options**
 +
 +To ''<​bpmn>''​ tag there can be added additional parameters:
 +  * ''​subprocess=collapse''​ or ''​subprocess=expand''​ - it's used for sub-processes to specify how it should be displayed
 +  * ''​diagram=before''​ or ''​diagram=after''​ - used to specify position of diagram to the code block
 +
 +===== Events =====
 +
 +Defining events - there are tree sections corresponding to tree event types:
 +
 +<​code>​
 +{
 + events:{
 + start:{
 + },
 + end:{
 + },
 + intermediate:​{
 + }
 + }
 +...
 +}
 +</​code>​
 +
 +**Event schema**
 +
 +Event can have specified parameters:
 +  * ''​name''​ - possible value: string in quotes "";​ name of the event
 +  * ''​type''​ - possible value: see Table 1; specifies what event is connected to the event (eg. ''​message''​);​ default type is none (no particular type is specified)
 +  * ''​throwing''​ - default: ''​false'',​ possible value: ''​true'';​ eg. error throwing vs error catching; default state for intermediate events is catching unless specified ''​throwing:​true''​ - it can be done for: ''​Message'',​ ''​Escalation'',​ ''​Compensation'',​ ''​Link'',​ ''​Signal''​ and ''​Multiple Events''​.
 +  * ''​nonInterrupting''​ - default: ''​false'',​ possible value: ''​true'';​ specifies whether or not the event interrupts the whole process (and should be dealt with) or not,  eg. Interrupting error makes some new branch of the flow on order to do something with the error vs nonInterrupting error only indicates sth and doesn'​t change the flow; default ''​false'',​ affected events: ''​Message'',​ ''​Timer'',​ ''​Escalation'',​ ''​Conditional'',​ ''​Signal'',​ ''​Multiple''​ and ''​Parallel Multiple''​.
 +
 +If there are parameters specified for the event there have to be event id, colon (:) and parameters in braces ({}) - like event_id1. However when there is only name specified for the event shorter version can be used - see event_id2.
 +
 +<​code>​
 +{
 +...
 + events:{
 + ...
 + intermediate:​{
 + event_id1:​ {
 + name: "​Intermediate event 1",
 + type: message,
 + nonInterrupting:​ true,
 + throwing:​ true
 + },
 +                        event_id2: "​Intermediate event 2",
 +                        ...
 + }
 + },
 +...
 +}
 +</​code>​
 +
 +__Table 1 - Events: Values for type parameter__
 +^Event ^Type ^type^
 +| None | Untyped events – a general start/end point or state change | |
 +| Message | Sending and receiving messages Yes message | ''​message''​ |
 +| Timer | Timeout, interval or point in time Yes timer | ''​timer''​ |
 +| Escalation | Delegation to the higher level of responsibility Yes escalation | ''​escalation''​ |
 +| Conditional | Dealing with changes in conditions, integrating business rules | ''​conditional''​ |
 +| Link | Forming a sequence flow through two corresponding Events | ''​link''​ |
 +| Error | Raising and catching errors Yes error | ''​error''​ |
 +| Cancel | Canceling the transaction or reacting to it Yes cancel | ''​cancel''​ |
 +| Compensation | Handling or triggering compensation Yes compensation | ''​compensation''​ |
 +| Signal | Emitting and receiving signals between Processes. Thrown signal can be caught many times | ''​signal''​|
 +| Multiple | Throwing all defined Events and reacting to anyof them | ''​multiple''​ |
 +| Parallel Multiple | Catching all defined parallel Events Yes parallel | ''​parallel''​ |
 +| Terminate | Terminating the Process Yes terminate | ''​terminate''​ |
 +
 +[[.:​bpwiki:​all_events | Types of Events]]
 +
 +===== Activities =====
 +
 +As mentioned before, activities can have one of four types (''​activityType''​):​ ''​Task'',​ ''​Transaction'',​ ''​Event Sub-Process''​ and ''​Call Activity''​. Assuming only basic attributes are defined (see schema Activity 1 below) default type of Activity is ''​Task'',​ other kind of activities can be set by using the type attribute (see the table). Additionally,​ an Activity can be recognized as ''​Sub-Process''​ when inside the activity definition (after the basic attributes) there are tags ''​events'',​ ''​activities'',​ ''​gateways''​ and ''​flow''​ (see schema Activity 2). 
 +
 +Parameters of activity:
 +  * ''​name''​ - possible value: string in quotes ””; name of the activity;
 +  * ''​type''​ - possible value: see Table 2; type is defined according to participant of task (see [[#​tasks|Task section]] ); can be defined only for Tasks, they are ignored while defined in Sub-Process;​
 +  * ''​activityType''​ - possible value: see Table 3; decribed above;
 +  * ''​markers''​ -  possible value: see Table 4; list of values (seperated with commas);
 +  * ''​boundary''​ -  possible value: identifier of event; activities can be interrupted by some event, eg. for the task of implementing assignment till the end of semester the event that will interrupt this task is actual end of the semester. Therefore if boundary is defined the task will have additional event "​sticked"​ to it, which means that it can be intruded by this event. Events themselves must be defined in the parent event:​intermediate section. ​
 +  * ''​instantiate''​ - default: ''​false'';​ possible values: ''​true''; ​
 +
 +[[.:​bpwiki:​boundary_example | Boundary Activity Example ]] - Example which has a boundary activity - when the time is up for the masters it gets interrupted.
 +
 +Activity defined as default type - ''​Task''​.
 +<​code>​
 +{
 +...
 + activities:​{
 + activity_id1:​ {
 + name: "​Activity 1",
 + type: user,
 + activityType:​ transaction,​
 + markers: [loop],
 + boundary:​ [event_in_parent_id],​
 + instantiate:​ true
 + }
 + },
 +...
 +}
 +</​code>​
 +
 +__Defining Sub-Process__
 +
 +Activity defined as ''​Sub-Process''​ (thanks to defining ''​events'',​ ''​activities'',​ ''​gateways''​ and ''​flow''​).
 +<​code>​
 +{
 +...
 + activities:​{
 + activity_id2:​ {
 + name: "​Activity 2 - Sub-Process",​
 + type: manual,
 + markers: [parallel],
 + boundary:​ [event_id],
 + events:{
 + },
 + activities:​{
 + },
 + gateways:​{
 + },
 + flow:{
 + }
 + }
 + },
 +...
 +}
 +</​code>​
 +[[.:​bpwiki:​subprocessinside_example | Example of Sub-Process defined as in schema above]]
 +<​code>​
 +{
 +...
 + activities:​ {
 + [[bpmn>​parent_link:​subprocess_link]]
 +
 + },
 +...
 +}</​bpmn>​
 +
 +</​code>​
 +In case subprocess isn't yet defined there will be empty link generated, so subprocess can be easily created.
 +
 +[[.:​bpwiki:​subprocess_example | Example of Sub-Process defined as in schema above]]
 +
 +[[.:​bpwiki:​subprocessmarker_example | Example of Sub-Process defined by marker subprocess]]
 +
 +Activity without additional parameters can be shortened only to identifier and name:
 +<​code>​
 +{
 +...
 + activities:​ ...
 + activity_id3:​ "​Activity 3 - Shortened",​
 +...
 +}
 +</​code>​
 +
 +__Table 2 - Acitivities:​ Values for type parameter - Only for Tasks!__
 +^Task Type ^Task Description ^ type ^
 +| Abstract | General task | | 
 +| Service | Indicates the use of some kind of service, like Web service or automated application| ''​service''​ |
 +| Send | Sending a message to another Participant | ''​send''​ |
 +| Receive | Receiving a message from another Participant | ''​receive''​ |
 +| User | Task performed by a human with the assistance of software application | ''​user''​ |
 +| Manual | Task performed by a human that does not require any software aid | ''​manual''​ |
 +| Business Rule | Mechanism for Process to provide input to the Business Rule Engine and receive answers | ''​business''​ |
 +| Script | Executing a specified script | ''​script''​ |
 +
 +__Table 3 - Acitivities:​ Values for activityType parameter__
 +^Activity Type^ Activity Description^ activityType^
 +| Task | Unit of work to be performed. Can be typed to indicate the kind of task. Can be atomic or compound (Sub-Process) |  ​
 +| Transaction | A group of logically connected activites, that may follow some protocol. | ''​transaction''​ | 
 +| Event Sub-Process | Places as a part of Process or Sub-Process. Depending on the starting event can interrupt the main flow or run in parallel. Activates when starting Event is triggered. | ''​event''​ | 
 +| Call Activity | Indicates a call tho globally defined Task or Sub-Process. | ''​call''​ | 
 +
 +__Table 4 - Acitivities:​ Values for markers parameter__
 +^Marker Type ^Marker Description ^marker ^
 +| Sub-Process | Indicates that Activity is a Sub-Process. Marked Activity may be in collapsed or extended state. | ''​subprocess''​ |
 +| Loop | Defines looping behavior based on a boolean condition | ''​loop''​ |
 +| Parallel | Allows for creation of a desired number of parallel Activity instances | ''​parallel''​ |
 +| Sequential | Allows for creation of a desired number of sequential Activity instances | ''​sequential''​ |
 +| Ad Hoc | Indicates a Process or Sub-Process with flexible or partially flexible ordering in which its Activities are executed. Final execution order is determined at the runtime | ''​adhoc''​ |
 +| Compensation | Indicates a compensation handler. It performs the steps necessary to reverse the effects of an Activity | ''​compensation''​ |
 +
 +===== Gateways =====
 +
 +Possible parameters for gateway:
 +
 +  * ''​name''​ - possible value: string in quotes ””; name of the activity;
 +  * ''​type''​ - default: ''​exclusive'';​ possible values: see Table 5; 
 +
 +<​code>​
 +{
 + gateways:{
 + gateway_id:​ {
 + name: "​Gateway 1",
 + type: parallel
 + }
 + },
 +}
 +</​code>​
 +
 +__Table 5 - Gateways: Values for type parameter__
 +^Gateway Type ^Gateway Description ^ type ^
 +| Exclusive | It activates exactly one of outgoing branches or waits for exactly one of the incoming ones | |
 +| Event-based | Followed by catching Events or the Receive Tasks, it activates the branch for the Event that was triggered first | ''​event''​ |
 +| Parallel | It activates all outgoing branches at the same time or waits for all incoming ones before outgoing flow is activated | ''​parallel''​ |
 +| Inclusive | It activates one or more outgoing branches at the same time or waits for all incoming ones before outgoing flow is activated | ''​inclusive''​ |
 +| Complex | Complex behavior that is not covered by other gateways | ''​complex''​ | 
 +
 +===== Flow =====
 +
 +Order of Flow Elements (which are the elements available in SimpleBPMN) is provided by Sequence Flow. Sequence Flow has exactly one source and one target. It can connect all the elements: events, tasks, sub-processes and gateways. When defining flow always connect two elements and use brackets (see schema below).
 +
 +There are three types of flow connections between elements:
 +  * normal connection;
 +  * conditional connection - it will make the "​Condition"​ appear above the arrow;
 +  * default connection.
 +
 +To define it see schema.
 +
 +<​code>​
 +{
 +...
 + flow:{
 + flow_normal:​ [
 + object_from_id,​
 + object_to_id
 + ],
 + flow_conditional:​ [
 + object_from_id,​
 + object_to_id,​
 + "​Condition"​
 + ],
 + flow_default:​ [
 + object_from_id,​
 + object_to_id,​
 + true
 + ]
 + }
 +...
 +}
 +</​code>​
 +
 +[[bpwiki:​process_order_fulfillment | Complicated example from book]] [[http://​www.omg.org/​spec/​BPMN/​2.0/​examples/​PDF/​10-06-02.pdf|BPMN 2.0 by Example]]
 +
 +===== Description of the files in SimpleBPMN Plugin =====
 +
 +[[.:​bpwiki:​files-desc | Description]]
docs/bpwiki-tutorial.txt · Last modified: 2017/09/19 16:31 (external edit)