当前位置: 首页>>代码示例>>Java>>正文


Java PvmActivity.getIncomingTransitions方法代码示例

本文整理汇总了Java中org.activiti.engine.impl.pvm.PvmActivity.getIncomingTransitions方法的典型用法代码示例。如果您正苦于以下问题:Java PvmActivity.getIncomingTransitions方法的具体用法?Java PvmActivity.getIncomingTransitions怎么用?Java PvmActivity.getIncomingTransitions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.activiti.engine.impl.pvm.PvmActivity的用法示例。


在下文中一共展示了PvmActivity.getIncomingTransitions方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getPreviousActivities

import org.activiti.engine.impl.pvm.PvmActivity; //导入方法依赖的package包/类
public List<PvmActivity> getPreviousActivities(PvmActivity pvmActivity) {
    List<PvmActivity> pvmActivities = new ArrayList<PvmActivity>();

    for (PvmTransition pvmTransition : pvmActivity.getIncomingTransitions()) {
        PvmActivity targetActivity = pvmTransition.getDestination();

        if ("userTask".equals(targetActivity.getProperty("type"))) {
            pvmActivities.add(targetActivity);
        } else {
            pvmActivities
                    .addAll(this.getPreviousActivities(targetActivity));
        }
    }

    return pvmActivities;
}
 
开发者ID:zhaojunfei,项目名称:lemon,代码行数:17,代码来源:FindPreviousActivitiesCmd.java

示例2: dealParallelGateway

import org.activiti.engine.impl.pvm.PvmActivity; //导入方法依赖的package包/类
private void dealParallelGateway(ActivityImpl ai) throws Exception {
    List<PvmTransition> incomingTransitions = ai.getIncomingTransitions();
    List<PvmTransition> outgoingTransitions = ai.getOutgoingTransitions();
    /*
     * 不支持多进多出的并发gateway。
     * 如果是多进一出,说明是并发的结束,直接返回。
     * 如果是一进多出,说明是并发的开始,需要处理。
     */
    int is = incomingTransitions.size();
    int os = outgoingTransitions.size();
    if (is <= 0 || os <= 0) {
        return;
    } else if (is > 1 && os > 1) {
        throw new Exception("RhoAutoRunner: do not support such kind of parallel gateway");
    } else if (os == 1) {
        return;
    }

    PvmActivity curAct = incomingTransitions.get(0).getSource();
    String type = (String) curAct.getProperty("type");
    List<String> curTaskList = new ArrayList<>();

    if (type.endsWith("Task")) {
        curTaskList.add((String) curAct.getProperty("name"));
    } else if (type.equals("exclusiveGateway")) {
        List<PvmTransition> ins = curAct.getIncomingTransitions();
        for (PvmTransition pi : ins) {
            PvmActivity pt = pi.getSource();
            String ptype = (String) pt.getProperty("type");
            if (ptype.endsWith("Task")) {
                curTaskList.add((String) pt.getProperty("name"));
            } else {
                throw new Exception("RhoAutoRunner: do not support such kind of parallel gateway");
            }
        }
    } else {
        throw new Exception("RhoAutoRunner: do not support such kind of parallel gateway, with zero pre tasks");
    }
    ParallelE pairList = new ParallelE();
    for (String curTaskName : curTaskList) {
        parallelCache.put(curTaskName, pairList);
    }


    List<PvmActivity> outActList = new ArrayList<>();
    for (PvmTransition outTransition : outgoingTransitions) {
        outActList.add(outTransition.getDestination());
    }

    addOutPair(pairList.list, outActList, 0);

}
 
开发者ID:YuhangGe,项目名称:activiti-spring-hibernate,代码行数:53,代码来源:RhoAutoRunner.java


注:本文中的org.activiti.engine.impl.pvm.PvmActivity.getIncomingTransitions方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。