The Send Task/receive task/manual task and Business rule task tasks are supported in BPMN. The Send task is primarily an email task and a mule task, while the business rule task is primarily the drools rule engine of JBoss.
1. Manual tasks and receiving tasks
Manual tasks are tasks that do not require any program or process engine to be driven automatically. When the process arrives at the task, it simply records the process history data and automatically leaves.
After the receiving task waits for outside notification, the process can proceed forward, notifying the need to use Runtimeservice's Sinal method.
<!--Manual Tasks -<ManualtaskID= "Manualtask1"name= "Manual Task"></Manualtask><!--Receiving Tasks -<ReceivetaskID= "Receivetask1"name= "Receive Task"></Receivetask>
//START ProcessProcessInstance pi = Runtimeservice.startprocessinstancebykey ("Process1");//querying the current tasklist<task> tasks =taskservice.createtaskquery (). List (); System.out.println ("The number of tasks performed after a manual task, before receiving a task:" + tasks.size ());//0List<processinstance> pis = runtimeservice.createprocessinstancequery (). List ();//1System.out.println ("Number of process instances after performing a manual task, before receiving a task:" +pis.size ());//let the process run forwardruntimeservice.signal (Pi.getid ());//Query ProcessPiS = Runtimeservice.createprocessinstancequery (). List ();//0
2. Mail tasks
The execution class is activitibehavior, corresponding to the implementation class Mailactivitibehavior.
<SendtaskID= "Mailtask1"name= "Mail Task"Activiti:type= "Mail"> <extensionelements> <Activiti:fieldname= "from"StringValue= "Sender Address" /> <Activiti:fieldname= "to"StringValue= "Recipient Address" /> <Activiti:fieldname= "Subject"StringValue= "Test" /> <Activiti:fieldname= "html"> <activiti:expression> <![cdata[> <Body> <TableBorder= "1"> <TR><TD>Name</TD> <TD>Age</TD> </TR> </Table> </Body> </HTML>]]></activiti:expression> </Activiti:field> </extensionelements></Sendtask>
You also need to provide configuration information for the mail server:
<BeanID= "Processengineconfiguration"class= "Org.activiti.engine.impl.cfg.StandaloneProcessEngineConfiguration"> <!--JDBC Configuration omitted - < Propertyname= "Mailserverhost"value= "Smtp.163.com"></ Property> < Propertyname= "Mailserverport"value= "+"></ Property> < Propertyname= "Mailserverusername"value= "Your 163 mailbox user name"></ Property> < Propertyname= "Mailserverpassword"value= "Your e-mail password"></ Property> </Bean>
When the process arrives at the task, the message is automatically sent according to the configuration.
ProcessInstance pi = Runtimeservice.startprocessinstancebykey ("Process1");
--Learning from: Crazy workflow Handouts
Process Tasks-manual/Receive/Mail tasks