![]() We want to grow the global economy by providing everyone with frictionless, accessible financial products. We will use the process variables, and pass them while creating the ProcessInstance.Our mission is to unlock the power of a borderless economy, for everyoneįinancial services are the backbone of our society, and our goal is to make them work for as many individuals and businesses as possible. In our example, at the start event, we need to pass the number of vacation days, the start date, and the reason. The ProcessDefinition is a blueprint, and the ProcessInstance is the runtime execution of it.įor a single ProcessDefinition, there can be multiple ProcessInstances.Īll the details related to the ProcessInstances can be accessed through the RuntimeService. Deploying a ProcessĪfter deploying the ProcessDefinition to Activiti Engine, we can execute the process by creating ProcessInstances. Also, we need to override its execute() method, which will be performed when the process execution reaches this step. These types of classes should extend the JavaDelegate. We have given the class SendEmailServiceTask.java. ![]() Service tasks are provided with some piece of code to execute (here, as a Java class). If disapproved, the Employee can either select to modify and resend the request, or do nothing. If approved, there is a Service task defined to send the confirmation email. The employee makes a vacation request, providing the number of days and the start date of vacation. Here, vacationApproved is the formProperty of the UserTask shown above.Īs we can see in the diagram, it is a very simple process. The conditional flow will be shown by adding the “conditionExpression” tag in the “sequenceFlow”: We have this piece of code as a Java class: With the ServiceTask, we need to define the piece of code to be executed. Similarly, the first user task, assigned to the user group “management”, will look like this: The BPMN 2.0 file,, for this process will have the start event defined as: To learn how we can work with different services and run a process, let's take an example of a process for “Employee vacation request”: DynamicBpmnService helps us to change anything in a process without redeploying it.ManagementService is related to the metadata and usually not required when creating an application.We can also set different history levels. HistoryService keeps track of the history of Activiti Engine.IdentityService manages the Users and Groups.It is used to define the start form and task form in a process. The API can be used without it, and without sacrificing any of its features. We can create a task, claim and complete a task, manipulate the assignee of the task, etc. The Tasks that need to be carried out manually by a user are at the core of the Activiti API. TaskService keeps track of the UserTasks.RuntimeService manages the ProcessInstances (currently running processes) as well as the process variables.This service deals with the static data related to a process definition RepositoryService helps us manipulate the deployment of process definitions.We'll discuss in brief the services provided by Activiti: ![]() ![]() UserTasks, as the name suggests, are such that they need to be carried out manually by a user. The most commonly used tasks are UserTasks and ServiceTasks. We can define conditions over these events.Īll the steps (or elements) in between the start and end are referred to as Tasks. Similarly, there is an EndEvent which indicates the end of the process. It indicates the entry point of the process. Once we start running a process definition, it can be referred to as a processĪ ProcessInstance is one execution of a ProcessDefinition.Ī StartEvent is associated with every business process. All the terms defined in this section are available as Java classes as well. It’s also possible to define them using Java code. Process definitions are mostly defined by the BPMN 2.0 standard. Deploying a process definition means loading the process definition into the Activiti database. It’s used to define the structure and behavior of different steps in the process. The capabilities of Spring are just used internally to create the ProcessEngine.Ī ProcessDefinition represents a business process. But, this does not mean that we can only use Activiti in a Spring environment. The sample code for the configuration file shows that it is just a Spring-based configuration. This statement will look for an file in the classpath, and construct a ProcessEngine based on the configuration in the file. Now we can obtain the ProcessEngine using the ProcessEngines class: ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine() An example of this configuration file is: ProcessEngine in Activiti, is typically configured using an XML file,.
0 Comments
Leave a Reply. |