本文整理汇总了Java中org.activiti.engine.impl.pvm.PvmActivity.getOutgoingTransitions方法的典型用法代码示例。如果您正苦于以下问题:Java PvmActivity.getOutgoingTransitions方法的具体用法?Java PvmActivity.getOutgoingTransitions怎么用?Java PvmActivity.getOutgoingTransitions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.activiti.engine.impl.pvm.PvmActivity
的用法示例。
在下文中一共展示了PvmActivity.getOutgoingTransitions方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: findNextUserTask
import org.activiti.engine.impl.pvm.PvmActivity; //导入方法依赖的package包/类
/**
* 递归查找下一个用户任务
*
* @param tranistion
* @return
*/
public List<PvmActivity> findNextUserTask(PvmTransition tranistion) {
List<PvmActivity> activities = new ArrayList<>();
PvmActivity nextActivity = tranistion.getDestination();
if (nextActivity == null)
return activities;
else if ("userTask".equals(nextActivity.getProperty("type"))) {
activities.add(nextActivity);
return activities;
} else {
List<PvmTransition> transitions = nextActivity.getOutgoingTransitions();
for (PvmTransition transition1 : transitions) {
activities.addAll(findNextUserTask(transition1));
}
return activities;
}
}
示例2: findUserTasks
import org.activiti.engine.impl.pvm.PvmActivity; //导入方法依赖的package包/类
private void findUserTasks(PvmActivity currentActivity, Map<String, PvmActivity> userTasks, Set<String> processedActivities)
{
// Only process activity if not already processed, to prevent endless loops
if(!processedActivities.contains(currentActivity.getId()))
{
processedActivities.add(currentActivity.getId());
if(isUserTask(currentActivity))
{
userTasks.put(currentActivity.getId(), currentActivity);
}
// Process outgoing transitions
if(currentActivity.getOutgoingTransitions() != null)
{
for(PvmTransition transition : currentActivity.getOutgoingTransitions())
{
if(transition.getDestination() != null)
{
findUserTasks(transition.getDestination(), userTasks, processedActivities);
}
}
}
}
}
示例3: findUserTasks
import org.activiti.engine.impl.pvm.PvmActivity; //导入方法依赖的package包/类
private void findUserTasks(PvmActivity currentActivity, Map<String, PvmActivity> userTasks, Set<String> processedActivities)
{
// Only process activity if not already processed, to prevent endless loops
if(!processedActivities.contains(currentActivity.getId()))
{
processedActivities.add(currentActivity.getId());
if(isUserTask(currentActivity))
{
userTasks.put(currentActivity.getId(), currentActivity);
}
// Process outgoing transitions
if(currentActivity.getOutgoingTransitions() != null)
{
for(PvmTransition transition : currentActivity.getOutgoingTransitions())
{
if(transition.getDestination() != null)
{
findUserTasks(transition.getDestination(), userTasks, processedActivities);
}
}
}
if (isSubProcess(currentActivity))
{
Map<String, Object> properties = ((ActivityImpl)currentActivity).getProperties();
PvmActivity startEvent = (PvmActivity) properties.get(ActivitiConstants.PROP_INITIAL_ACTIVITY);
findUserTasks(startEvent, userTasks, processedActivities);
}
}
}
示例4: getNextActivities
import org.activiti.engine.impl.pvm.PvmActivity; //导入方法依赖的package包/类
public List<PvmActivity> getNextActivities(PvmActivity pvmActivity) {
List<PvmActivity> pvmActivities = new ArrayList<PvmActivity>();
for (PvmTransition pvmTransition : pvmActivity.getOutgoingTransitions()) {
PvmActivity targetActivity = pvmTransition.getDestination();
if ("userTask".equals(targetActivity.getProperty("type"))) {
pvmActivities.add(targetActivity);
} else {
pvmActivities.addAll(this.getNextActivities(targetActivity));
}
}
return pvmActivities;
}
示例5: visitNode
import org.activiti.engine.impl.pvm.PvmActivity; //导入方法依赖的package包/类
/**
* 遍历.
*/
public Node visitNode(PvmActivity pvmActivity) {
if (visitedNodeIds.contains(pvmActivity.getId())) {
return null;
}
visitedNodeIds.add(pvmActivity.getId());
Node currentNode = new Node();
currentNode.setId(pvmActivity.getId());
currentNode.setName(this.getString(pvmActivity.getProperty("name")));
currentNode.setType(this.getString(pvmActivity.getProperty("type")));
for (PvmTransition pvmTransition : pvmActivity.getOutgoingTransitions()) {
PvmActivity destination = pvmTransition.getDestination();
Node targetNode = this.visitNode(destination);
if (targetNode == null) {
continue;
}
Edge edge = new Edge();
edge.setId(pvmTransition.getId());
edge.setSrc(currentNode);
edge.setDest(targetNode);
currentNode.getOutgoingEdges().add(edge);
}
return currentNode;
}
示例6: getTaskDefinition
import org.activiti.engine.impl.pvm.PvmActivity; //导入方法依赖的package包/类
@Override
public List<TaskDefinition> getTaskDefinition(ActivityImpl activityImpl, String elString) {
List<TaskDefinition> taskDefinitionList = new ArrayList<>();
List<TaskDefinition> nextTaskDefinition;
if ("userTask".equals(activityImpl.getProperty("type"))) {
TaskDefinition taskDefinition = ((UserTaskActivityBehavior) activityImpl.getActivityBehavior()).getTaskDefinition();
taskDefinitionList.add(taskDefinition);
} else {
List<PvmTransition> pvmTransitions = activityImpl.getOutgoingTransitions();
List<PvmTransition> outTransitionsTemp;
for (PvmTransition tr : pvmTransitions) {
PvmActivity pvmActivity = tr.getDestination(); //获取线路的终点节点
if ("exclusiveGateway".equals(pvmActivity.getProperty("type")) || "parallelGateway".equals(pvmActivity.getProperty("type"))) {
outTransitionsTemp = pvmActivity.getOutgoingTransitions();
if (outTransitionsTemp.size() == 1) {
nextTaskDefinition = getTaskDefinition((ActivityImpl) outTransitionsTemp.get(0).getDestination(), elString);
taskDefinitionList.addAll(nextTaskDefinition);
} else if (outTransitionsTemp.size() > 1) {
for (PvmTransition tr1 : outTransitionsTemp) {
Object s = tr1.getProperty("conditionText");
if (elString.equals(s.toString().trim())) {
nextTaskDefinition = getTaskDefinition((ActivityImpl) tr1.getDestination(), elString);
taskDefinitionList.addAll(nextTaskDefinition);
}
}
}
} else if ("userTask".equals(pvmActivity.getProperty("type"))) {
taskDefinitionList.add(((UserTaskActivityBehavior) ((ActivityImpl) pvmActivity).getActivityBehavior()).getTaskDefinition());
}
}
}
return taskDefinitionList;
}
示例7: testProcessDefinitionIntrospection
import org.activiti.engine.impl.pvm.PvmActivity; //导入方法依赖的package包/类
public void testProcessDefinitionIntrospection() {
String deploymentId = repositoryService
.createDeployment()
.addClasspathResource("org/activiti/engine/test/db/processOne.bpmn20.xml")
.deploymentProperty(DeploymentProperties.DEPLOY_AS_FLOWABLE5_PROCESS_DEFINITION, Boolean.TRUE)
.deploy()
.getId();
String procDefId = repositoryService.createProcessDefinitionQuery().singleResult().getId();
ProcessEngineConfigurationImpl activiti5ProcessEngineConfig = (ProcessEngineConfigurationImpl) processEngineConfiguration.getFlowable5CompatibilityHandler().getRawProcessConfiguration();
ReadOnlyProcessDefinition processDefinition = ((RepositoryServiceImpl) activiti5ProcessEngineConfig.getRepositoryService()).getDeployedProcessDefinition(procDefId);
assertEquals(procDefId, processDefinition.getId());
assertEquals("Process One", processDefinition.getName());
assertEquals("the first process", processDefinition.getProperty("documentation"));
PvmActivity start = processDefinition.findActivity("start");
assertNotNull(start);
assertEquals("start", start.getId());
assertEquals("S t a r t", start.getProperty("name"));
assertEquals("the start event", start.getProperty("documentation"));
assertEquals(Collections.EMPTY_LIST, start.getActivities());
List<PvmTransition> outgoingTransitions = start.getOutgoingTransitions();
assertEquals(1, outgoingTransitions.size());
assertEquals("${a == b}", outgoingTransitions.get(0).getProperty(BpmnParse.PROPERTYNAME_CONDITION_TEXT));
PvmActivity end = processDefinition.findActivity("end");
assertNotNull(end);
assertEquals("end", end.getId());
PvmTransition transition = outgoingTransitions.get(0);
assertEquals("flow1", transition.getId());
assertEquals("Flow One", transition.getProperty("name"));
assertEquals("The only transitions in the process", transition.getProperty("documentation"));
assertSame(start, transition.getSource());
assertSame(end, transition.getDestination());
repositoryService.deleteDeployment(deploymentId);
}
示例8: isReachable
import org.activiti.engine.impl.pvm.PvmActivity; //导入方法依赖的package包/类
protected boolean isReachable(PvmActivity srcActivity, PvmActivity targetActivity, Set<PvmActivity> visitedActivities) {
if (srcActivity.equals(targetActivity)) {
return true;
}
// To avoid infinite looping, we must capture every node we visit
// and check before going further in the graph if we have already visitied the node.
visitedActivities.add(srcActivity);
List<PvmTransition> transitionList = srcActivity.getOutgoingTransitions();
if(transitionList != null && transitionList.size() > 0) {
for (PvmTransition pvmTransition : transitionList) {
PvmActivity destinationActivity = pvmTransition.getDestination();
if(destinationActivity != null && !visitedActivities.contains(destinationActivity)) {
boolean reachable = isReachable(destinationActivity, targetActivity, visitedActivities);
// If false, we should investigate other paths, and not yet return the result
if(reachable) {
return true;
}
}
}
}
return false;
}
示例9: testProcessDefinitionIntrospection
import org.activiti.engine.impl.pvm.PvmActivity; //导入方法依赖的package包/类
public void testProcessDefinitionIntrospection() {
String deploymentId = repositoryService
.createDeployment()
.addClasspathResource("org/activiti/engine/test/db/processOne.bpmn20.xml")
.deploy()
.getId();
String procDefId = repositoryService.createProcessDefinitionQuery().singleResult().getId();
ReadOnlyProcessDefinition processDefinition = ((RepositoryServiceImpl)repositoryService).getDeployedProcessDefinition(procDefId);
assertEquals(procDefId, processDefinition.getId());
assertEquals("Process One", processDefinition.getName());
assertEquals("the first process", processDefinition.getProperty("documentation"));
PvmActivity start = processDefinition.findActivity("start");
assertNotNull(start);
assertEquals("start", start.getId());
assertEquals("S t a r t", start.getProperty("name"));
assertEquals("the start event", start.getProperty("documentation"));
assertEquals(Collections.EMPTY_LIST, start.getActivities());
List<PvmTransition> outgoingTransitions = start.getOutgoingTransitions();
assertEquals(1, outgoingTransitions.size());
assertEquals("${a == b}", outgoingTransitions.get(0).getProperty(BpmnParse.PROPERTYNAME_CONDITION_TEXT));
PvmActivity end = processDefinition.findActivity("end");
assertNotNull(end);
assertEquals("end", end.getId());
PvmTransition transition = outgoingTransitions.get(0);
assertEquals("flow1", transition.getId());
assertEquals("Flow One", transition.getProperty("name"));
assertEquals("The only transitions in the process", transition.getProperty("documentation"));
assertSame(start, transition.getSource());
assertSame(end, transition.getDestination());
repositoryService.deleteDeployment(deploymentId);
}