JBPM Notify Custom

Source: Internet
Author: User
Tags jbpm

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); }

}

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.