• jBPM4.4之流程引擎对象ProcessEngine


      在jBPM4.4中,所有的服务接口都是通过ProcessEngine对象获得的。

    1、关于ProcessEngine

      1)ProcessEngine通过Configuration类构建,Configuration以单例模式获取ProcessEngine对象。

    /** get the singleton ProcessEngine that is created from the default
       * configuration file 'jbpm.cfg.xml'. */
      public static ProcessEngine getProcessEngine() {
        if (singleton == null) {
          synchronized (Configuration.class) {
            if (singleton == null) {
              singleton = new Configuration().setResource("jbpm.cfg.xml").buildProcessEngine();
            }
          }
        }
        return Configuration.singleton;
      }

      2)ProcessEngine是线程安全的,所有的线程和请求都可以使用同一个ProcessEngine对象。

    2、获取ProcessEngine对象

      1)方式一:使用classpath根目录下的默认配置文件jbpm.cfg.xml创建一个单例的ProcessEngine。

     ProcessEngine processEngine = Configuration.getProcessEngine();

      2)方式二:指定其他位置的jBPM配置文件,如src根目录config包下的my-jbpm-cfg.xml。

    ProcessEngine processEngine = new Configuration()
          .setResource("config/my-jbpm-cfg.xml")
          .buildProcessEngine();

    3、通过ProcessEngine对象获取各种服务接口

      1)获取RepositoryService接口。

    RepositoryService repositoryService = processEngine.getRepositoryService();

      RepositoryService----流程资源服务接口。提供对流程定义的部署、查询、删除和流程图查看等操作。

      2)获取ExecutionService接口。

    ExecutionService executionService = processEngine.getExecutionService();

      ExecutionService----流程执行服务接口。提供启动流程实例、推进、删除等操作。

      3)获取TaskService接口。

    TaskService taskService = processEngine.getTaskService();

      TaskService----人工任务服务接口。提供对任务的创建、提交、查询、保存、删除等操作。

      4)获取HistoryService接口。

    HistoryService historyService = processEngine.getHistoryService();

      HistoryService----流程历史服务接口。提供对任务的管理操作。提供对流程历史库中历史流程实例、历史活动实例等记录的查询。

      5)获取ManagementService接口。

    ManagementService managementService = processEngine.getManagementService();

      ManagementService----流程管理控制服务接口。

      6)获取IdentityService接口。

    IdentityService identityService = processEngine.getIdentityService();

      IdentityService----身份认证服务接口。提供对流程用户、用户组管理。

      

      

      

      

  • 相关阅读:
    apache安全—用户访问控制
    hdu 3232 Crossing Rivers 过河(数学期望)
    HDU 5418 Victor and World (可重复走的TSP问题,状压dp)
    UVA 11020 Efficient Solutions (BST,Splay树)
    UVA 11922 Permutation Transformer (Splay树)
    HYSBZ 1208 宠物收养所 (Splay树)
    HYSBZ 1503 郁闷的出纳员 (Splay树)
    HDU 5416 CRB and Tree (技巧)
    HDU 5414 CRB and String (字符串,模拟)
    HDU 5410 CRB and His Birthday (01背包,完全背包,混合)
  • 原文地址:https://www.cnblogs.com/luxh/p/2607380.html
Copyright © 2020-2023  润新知