Różnice

Różnice między wybraną wersją a wersją aktualną.

Odnośnik do tego porównania

Both sides previous revision Poprzednia wersja
Nowa wersja
Poprzednia wersja
Nowa wersja Both sides next revision
pl:dydaktyka:dss:lab07 [2019/12/15 19:44]
kkluza [Dalsza rozbudowa modelu]
pl:dydaktyka:dss:lab07 [2019/12/16 17:17]
kkluza
Linia 1: Linia 1:
-====== ​Basics of BPM systems ​======+====== ​Process execution in a BPM system ​======
  
 ===== Activiti BPM Platform ===== ===== Activiti BPM Platform =====
Linia 8: Linia 8:
  
 During the lab, we will use Activiti 5.22. It can be installed from [[https://​www.activiti.org/​get-started]] ​ During the lab, we will use Activiti 5.22. It can be installed from [[https://​www.activiti.org/​get-started]] ​
-or used online on the temporary server: [[http://​167.172.110.65:​8080/​activiti-explorer/​]].+or used online on the temporary server: [[http://​167.172.110.64:​8080/​activiti-explorer/​]].
  
 Log in to an admin account: Log in to an admin account:
Linia 23: Linia 23:
  
 On the Groups tab (Manage menu), check the existing user groups. ​ On the Groups tab (Manage menu), check the existing user groups. ​
-As an administrator user, we will use the kermit user for the time being, ​ +As an administrator user, create your own admin account. 
-but we will also need some users who are not administrators. +Remember to assign a unique identifier. 
- +so we would not have to use the same kermit user 
-Create your new user. Remember to assign ​a unique ​identifier+You will also need some users who are not administrators, 
 +so create a new regular ​user account (remember about a unique ​id) 
  
 ==== A new process model ==== ==== A new process model ====
  
-In order to get acquainted with the application, ​we will prepare a very simplified model of gathering offers.+In order to get acquainted with the application, ​as an administrator,​ you will prepare a very simplified model of gathering offers.
  
 Select the **Processes** tab from the menu. You should see 3 tabs: Select the **Processes** tab from the menu. You should see 3 tabs:
Linia 37: Linia 38:
   - //Model workspace// -- to create new models and to implement or edit existing process models.   - //Model workspace// -- to create new models and to implement or edit existing process models.
  
-In the opened **Activiti Modeler** application window, set the process attributes ​(on the right side of the window).+In the opened **Alfresco ​Activiti Modeler** application window, set the process attributes.
 The essential elements are the process identifier (//Process identifier//​) and the process name (//Name//), The essential elements are the process identifier (//Process identifier//​) and the process name (//Name//),
 which will allow you to distinguish your process from other processes or other users' processes. ​ which will allow you to distinguish your process from other processes or other users' processes. ​
 Complete also the process author field (//Process author//). Complete also the process author field (//Process author//).
 +
 +{{  :​pl:​dydaktyka:​dss:​lab:​activiti-process-id.png?​500 ​ |}}
  
 ==== Simple process modelling ==== ==== Simple process modelling ====
Linia 48: Linia 51:
 {{  :​pl:​dydaktyka:​bim:​lab1:​proces1-diagram.png ​ |}} {{  :​pl:​dydaktyka:​bim:​lab1:​proces1-diagram.png ​ |}}
  
-As in the case of the process, for the BPMN elements, ​we can set the attributes ​on the right side.+As in the case of the process, for the BPMN elements, ​you can set the selected ​attributes:
    
-  * For //Start event//:+  * for //Start event//:
     * //​Documentation//:​ Start proceeding with an offer.     * //​Documentation//:​ Start proceeding with an offer.
     * //​Initiator//:​ initiator (the user who initiated the process will be stored in this variable)     * //​Initiator//:​ initiator (the user who initiated the process will be stored in this variable)
     * //Name//: Offer received     * //Name//: Offer received
-    * //Form properties//​ - click on ... and in the new window set the properties according to the following screenshot:​\\ +    * //Form properties// ​-- click on ... and in the new window set the properties according to the following screenshot:​\\
-{{  :​pl:​dydaktyka:​bim:​lab1::​form-properties.png ​ |}}+
  
-  ​For //Specify offer// task:+{{  :​pl:​dydaktyka:​dss:​lab:​form-properties-alfresco.png?​400 ​ |}} 
 + 
 +  ​for //Specify offer// task:
     * //​Documentation//:​ Please add available specification for an offer as attachments.     * //​Documentation//:​ Please add available specification for an offer as attachments.
-    * //​Assignments//: ​we have three possibilities\\+    * //​Assignments//: ​there are three possibilities\\
       * ''​assignee''​ -- assign a task to a specific user,       * ''​assignee''​ -- assign a task to a specific user,
       * ''​candidateUsers''​ -- assign a task so that any of several users can perform it,       * ''​candidateUsers''​ -- assign a task so that any of several users can perform it,
Linia 66: Linia 70:
 In our case, set only the variable ''​assignee''​ to ''​${initiator}''​ -- this means that as a task executor, we indicate the person who started the process. In our case, set only the variable ''​assignee''​ to ''​${initiator}''​ -- this means that as a task executor, we indicate the person who started the process.
  
-In addition, for this task we also set //Form properties//:​+In addition, for this taskwe also set //Form properties//:​
    * //​Specifications details// (id: ''​specDetails''​) -- level of detail of the specification of the contract offer (for now we set it as a ''​boolean''​),​ in the next part, we will transform this variable into an enum type (accurate, sufficient, insufficient).    * //​Specifications details// (id: ''​specDetails''​) -- level of detail of the specification of the contract offer (for now we set it as a ''​boolean''​),​ in the next part, we will transform this variable into an enum type (accurate, sufficient, insufficient).
    * //Person responsible//​ (id: ''​responsible''​) -- a person assigned to the formal analysis of the application (responsible for carrying out the analysis); such a person will be assigned to a variable.    * //Person responsible//​ (id: ''​responsible''​) -- a person assigned to the formal analysis of the application (responsible for carrying out the analysis); such a person will be assigned to a variable.
Linia 75: Linia 79:
 ==== Executing a simple process model ==== ==== Executing a simple process model ====
  
-Save a model and exit **Activiti Modeler**.+Save a model and exit **Alfresco ​Activiti Modeler**.
 Go back to **Activiti Explorer**. Go back to **Activiti Explorer**.
 In //Model workspace//,​ select your process from the menu In //Model workspace//,​ select your process from the menu
Linia 95: Linia 99:
  
 Historic data of the process are saved in the database, which is available in the //​Database//​ tab (in the **Manage** tab). Find the table ''​ACT_HI_PROCINST''​ and find your process there.  ​ Historic data of the process are saved in the database, which is available in the //​Database//​ tab (in the **Manage** tab). Find the table ''​ACT_HI_PROCINST''​ and find your process there.  ​
-Because for this laboratory, Activiti installation with Activiti Modeler does not save models permanently,​ save your model on the hard disk. To do this from the menu //​Deployments//​ select //Show all// and search for your process. Save your process file (file with extension **.bpmn20.xml**) and view its syntax. Note some process tag attributes, as well as the additional attributes of other process elements used by Activiti.+Because for this laboratory, Activiti installation with Alfresco ​Activiti Modeler does not save models permanently,​ save your model on the hard disk. To do this from the menu //​Deployments//​ select //Show all// and search for your process. Save your process file (file with extension **.bpmn20.xml**) and view its syntax. Note some process tag attributes, as well as the additional attributes of other process elements used by Activiti.
  
  
Linia 163: Linia 167:
 Please include in the body of the e-mail data held in a variable of the process instance. Please include in the body of the e-mail data held in a variable of the process instance.
  
 +=== Script task ===
 +
 +Some of the extensions below may require to use an Activiti Designer extension to an Eclipse platform.
 +
 +Extend the model to the form as shown in the diagram below:\\
 +
 +{{  :​pl:​dydaktyka:​bim:​lab3:​process8-eclipse-example.png ​ |}}
 +
 +For the given properties prepare a form in //Set formal conditions//​ task (boolean type):
 +  * ''​formalCertificates''​ -- The company has the required certificates
 +  * ''​formalExperience''​ -- The company has sufficient experience
 +  * ''​formalConflicts''​ -- Offer causes conflict with other orders
 +
 +Depending on your needs, you can set the default values in the appropriate fields using the ''​default''​ attribute.
 +
 +In the //Check formal conditions//​ task, select the language ''​groovy'',​ then set the appropriate value (''​negative''​ or ''​positive''​) of the ''​resOffer''​ variable. To define a variable in the groove and then export it to your process, use the following syntax:
 +<code groovy>
 +def resOffer = "​negative"  ​
 +/* TODO: check the conditions and if necessary, ​
 +convert resOffer to positive
 +*/
 +execution.setVariable("​result",​ resOffer)
 +</​code>​
 +
 +The variable can also be displayed within some //​UserTask//​ by adding a tag in XML:
 +<code xml><​documentation>​Formal condition check result is: ${result}</​documentation></​code>​
 +
 +The elements of the [[wp>​Groovy (programming language)]] are supported according to its syntax. For checking the syntax, you  can try [[http://​groovyconsole.appspot.com/​|online console]].
 +
 +{{:​pl:​dydaktyka:​bim:​lab3:​eclipse2-designer-gateway.png?​200 ​ |}}
 +
 +** Completion of the process with a negative result **
 +
 +If the result of the formal fulfillment of the conditions is negative, the process should end.
 +Add a gateway that will control the flow depending on the result, in order to finish the process accordingly.
 +
 +=== Multi instance task ===
 +
 +** Approval of the offer by the members of the Management Board **
 +
 +In order to complete the process, we will model the approval of the offer by the members of the Management Board.
 +
 +{{  :​pl:​dydaktyka:​bim:​lab3:​explorer2-execution-multiinstance.png|}}
 +For this purpose, the "​Approve offer" task should be defined as multi-instance task. \\
 +The following parameters are available in the ''​Multi instance''​ tab in the Activiti eclipse environment: ​
 +  * **Sequential** -- sequential (''​true''​) or parallel (''​false''​) execution,
 +  * **Loop cardinality** -- number of instances (checked only once, when creating a task), ​
 +  * **Collection** -- collection variable (a list of users who are to perform the task),
 +  * **Element variable** -- a variable that stores individual users in order to assign them to a task,
 +  * **Completion condition** -- the condition for completing the task.
 +
 +In [[https://​www.activiti.org/​5.x/​userguide/​|Activiti User Guide]], check how to define the appropriate condition for completing a task.
 +Let's assume that the Company considers a board decision to have been made if it was made by at least two of the three board members. Since we have not yet defined the board variable, please add the board variable, which is a list of board members (consisting of existing Activiti users). ​
  
 +Then, start the process and test it for different scenarios.
pl/dydaktyka/dss/lab07.txt · ostatnio zmienione: 2020/12/07 13:28 przez kkluza
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0