本文整理汇总了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;
}
示例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);
}