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


Java PvmActivity.getOutgoingTransitions方法代码示例

本文整理汇总了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;
    }
}
 
开发者ID:bill1012,项目名称:AdminEAP,代码行数:23,代码来源:RuntimePageServiceImpl.java

示例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);
                }
            }
        }
    }
}
 
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:25,代码来源:ActivitiTypeConverter.java

示例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);
        }
    }
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:32,代码来源:ActivitiTypeConverter.java

示例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;
}
 
开发者ID:zhaojunfei,项目名称:lemon,代码行数:16,代码来源:FindNextActivitiesCmd.java

示例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;
}
 
开发者ID:zhaojunfei,项目名称:lemon,代码行数:33,代码来源:ActivitiGraphBuilder.java

示例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;
}
 
开发者ID:hs-web,项目名称:hsweb-framework,代码行数:34,代码来源:BpmActivityServiceImp.java

示例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);
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:40,代码来源:ProcessDefinitionPersistenceTest.java

示例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;
  }
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:28,代码来源:InclusiveGatewayActivityBehavior.java

示例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);
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:38,代码来源:ProcessDefinitionPersistenceTest.java


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