One, as shown:
Second, the implementation of the class
public class Activitybehaviourimpl implements externalactivitybehaviour{
private static final long Serialversionuid = 1L;
The task is executed immediately, leaving the default
@Override public
void execute (activityexecution execution) throws Exception {
SYSTEM.OUT.PRINTLN ("Send a Notice");
The default connection
//execution.takedefaulttransition ();
Use the specified line name
//execution.take (transitionname);
Do not leave, but wait on this activity until the external call to the Signal method
execution.waitforsignal ();
}
This activity is stopped by invoking the code executed before Signalexecution () is left active
//If Execute does not stop, do not execute this method
@Override public
void Signal ( Activityexecution execution, String signalname, map<string,?> parameters) throws Exception {
SYSTEM.OUT.PRINTLN ("Signal---------");
}
Third, the use of:
public class Processdecisition {private static processengine Processengine = CONFIGURATION.G
Etprocessengine (); @Test public void Testprocess () throws Exception {//deploy String Deployid = Processengine.getrepositorys Ervice (). Createdeployment (). Addresourcefromclasspath ("Custom/custom.jpdl.xml"). ADDRESOURCEFROMC
Lasspath ("Custom/custom.png"). deploy ();
SYSTEM.OUT.PRINTLN ("Deployment completed: deployid==" +deployid);
ProcessInstance pi = Processengine.getexecutionservice (). Startprocessinstancebykey ("Custom");
System.out.println ("Start Up: processinstanceid==" +pi.getid ());
SYSTEM.OUT.PRINTLN ("ongoing activity name = =" +pi.findactiveactivitynames ()); @Test public void Testsignal () throws Exception {//jbpm4_execution table _id field String Executionid
= "custom.360008";
Processengine.getexecutionservice (). Signalexecutionbyid (Executionid); }
}