Process Tasks-manual/Receive/Mail tasks

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.