Friday 22 April 2016

Creating our first process in Activiti BPM.

Now is the right time to look at one simple process in Activiti. We will be using the Eclipse IDE for designing the business process. For now, we will just gain an understanding about creating a process.

We will create a simple leave process for employees in which we will have a script task and a user task. A script task is used for adding some logic within a process and a user task is used to indicate that there is some human interaction required in the process. 

Perform the following steps to create a process in Activiti:
  1. Create a new Activiti project in Eclipse by navigating to File > New > Project > Activiti. Project and name your project SimpleLeave-Process.The 
  2. SimpleLeave-Process project will have a folder structure as shown in the following screenshot:
  3. Now create an Activiti Diagram in the src/main/rersource/diagram folder structure.
  4. To create a diagram, navigate to File > New > Other > Activiti Diagram and name your diagram SimpleLeaveProcess. The folder structure is shown in the following screenshot:
  5. On opening the .bpmn file, a white canvas will appear on which you can design the business process.
  6. To draw a business process, there is a Palette option available which contains most of the BPMN diagrams for designing the business process. First, we will be adding a StartEvent on the canvas from the Event tab of the Palette option. All these options  are shown in the following screenshot:
  7. To add a script task, click on StartEvent and it will display the options as shown in the following screenshot. From those options, select the new element option, which will list down all the elements; from those elements, select Create script task, as shown in the following screenshot:
  8. To add a user task, click on Script Task and select new user task, which is the optiondisplayed with a human icon as shown in the following screenshot:
  9. As each and every business process should have at least one end event, to add an end event, click on User Task and select the new end event option, as shown in the following screenshot: 
  10. After adding the end event to the process, your business process should look similar to the following screenshot: 

  11. Now we have to make some changes to the properties of the process.
  12. First, we will change the properties of the start event. Select the start event, open the Properties tab, and add Form Properties in the Form tab using the New button as shown in the following screenshot:
  13. Now, edit the properties for the script task. In the Main config tab, there is a Script field available; within that, insert the print statement out:println"ApplyforLeaveby"+Empname;. The Empname property is the form property that we created in the start event. The script task will print the message on the console when it is executed, as shown in the following screenshot:
  14. Now we will edit the user task properties. In the General tab, we will populate the Name property, which will be displayed in the user task node, as shown in the following screenshot:
  15. As the user task is to be performed by a specific user, we have to provide the name of the user who will be responsible for executing it.
  16. We have to populate the Assignee property of the Main config tab with the name of the person to whom the task should be assigned; as shown in the following screenshot, we will be assigning it to kermit:
  17. We can  view the .bpmn file in the XML format. Right-click on the SimpleLeaveProcess.bpmn  file, browse to OpenWith | XML Editor, and it will be available in the XML format. The result of this step is shown in the following screenshot:

No comments:

Post a Comment

Thanks to comment our blog. i will contact you as soon as possible

Create Thumbnail in Video in Spring and ffmpeg

import java.awt.image.BufferedImage; import java.io.File; import java.io.IOException; import javax.imageio.ImageIO; import org.jcodec.api.Fr...