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


Java TransitionImpl类代码示例

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


TransitionImpl类属于org.activiti.engine.impl.pvm.process包,在下文中一共展示了TransitionImpl类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: take

import org.activiti.engine.impl.pvm.process.TransitionImpl; //导入依赖的package包/类
/**
 * @param fireActivityCompletionEvent This method can be called from other places (like {@link #takeAll(List, List)}), where the event is already fired. In that case, false is passed an no second event is fired.
 */
@Override
public void take(PvmTransition transition, boolean fireActivityCompletionEvent) {

    if (fireActivityCompletionEvent) {
        fireActivityCompletedEvent();
    }

    if (this.transition != null) {
        throw new PvmException("already taking a transition");
    }
    if (transition == null) {
        throw new PvmException("transition is null");
    }
    setActivity((ActivityImpl) transition.getSource());
    setTransition((TransitionImpl) transition);
    performOperation(AtomicOperation.TRANSITION_NOTIFY_LISTENER_END);
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:21,代码来源:ExecutionEntity.java

示例2: turnTransition

import org.activiti.engine.impl.pvm.process.TransitionImpl; //导入依赖的package包/类
public void turnTransition(String taskId, String activityId,  
        Map<String, Object> variables) throws Exception {  
    // 当前节点  
    ActivityImpl currActivity = findActivitiImpl(taskId, null);  
    // 清空当前流向  
    List<PvmTransition> oriPvmTransitionList = clearTransition(currActivity);  
  
    // 创建新流向  
    TransitionImpl newTransition = currActivity.createOutgoingTransition();  
    // 目标节点  
    ActivityImpl pointActivity = findActivitiImpl(taskId, activityId);  
    // 设置新流向的目标节点  
    newTransition.setDestination(pointActivity);  
  
    // 执行转向任务  
    taskService.complete(taskId, variables);  
    // 删除目标节点新流入  
    pointActivity.getIncomingTransitions().remove(newTransition);  
  
    // 还原以前流向  
    restoreTransition(currActivity, oriPvmTransitionList);  
}
 
开发者ID:v5developer,项目名称:maven-framework-project,代码行数:23,代码来源:ActivitiWorkFlowServiceImpl.java

示例3: executeParse

import org.activiti.engine.impl.pvm.process.TransitionImpl; //导入依赖的package包/类
@Override
protected void executeParse(BpmnParse bpmnParse, SequenceFlow sequenceFlow) {

    ScopeImpl scope = bpmnParse.getCurrentScope();

    ActivityImpl sourceActivity = scope.findActivity(sequenceFlow.getSourceRef());
    ActivityImpl destinationActivity = scope.findActivity(sequenceFlow.getTargetRef());

    Expression skipExpression;
    if (StringUtils.isNotEmpty(sequenceFlow.getSkipExpression())) {
        ExpressionManager expressionManager = bpmnParse.getExpressionManager();
        skipExpression = expressionManager.createExpression(sequenceFlow.getSkipExpression());
    } else {
        skipExpression = null;
    }

    TransitionImpl transition = sourceActivity.createOutgoingTransition(sequenceFlow.getId(), skipExpression);
    bpmnParse.getSequenceFlows().put(sequenceFlow.getId(), transition);
    transition.setProperty("name", sequenceFlow.getName());
    transition.setProperty("documentation", sequenceFlow.getDocumentation());
    transition.setDestination(destinationActivity);

    if (StringUtils.isNotEmpty(sequenceFlow.getConditionExpression())) {
        Condition expressionCondition = new UelExpressionCondition(sequenceFlow.getConditionExpression());
        transition.setProperty(PROPERTYNAME_CONDITION_TEXT, sequenceFlow.getConditionExpression());
        transition.setProperty(PROPERTYNAME_CONDITION, expressionCondition);
    }

    createExecutionListenersOnTransition(bpmnParse, sequenceFlow.getExecutionListeners(), transition);

}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:32,代码来源:SequenceFlowParseHandler.java

示例4: createBPMNEdge

import org.activiti.engine.impl.pvm.process.TransitionImpl; //导入依赖的package包/类
public void createBPMNEdge(String key, List<GraphicInfo> graphicList) {
    FlowElement flowElement = bpmnModel.getFlowElement(key);
    if (flowElement != null && sequenceFlows.containsKey(key)) {
        TransitionImpl sequenceFlow = sequenceFlows.get(key);
        List<Integer> waypoints = new ArrayList<>();
        for (GraphicInfo waypointInfo : graphicList) {
            waypoints.add((int) waypointInfo.getX());
            waypoints.add((int) waypointInfo.getY());
        }
        sequenceFlow.setWaypoints(waypoints);
    } else if (bpmnModel.getArtifact(key) != null) {
        // it's an association, so nothing to do
    } else {
        LOGGER.warn("Invalid reference in 'bpmnElement' attribute, sequenceFlow {} not found", key);
    }
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:17,代码来源:BpmnParse.java

示例5: eventNotificationsCompleted

import org.activiti.engine.impl.pvm.process.TransitionImpl; //导入依赖的package包/类
@Override
protected void eventNotificationsCompleted(InterpretableExecution execution) {
  TransitionImpl transition = execution.getTransition();
  ActivityImpl destination = null;
  if(transition == null) { // this is null after async cont. -> transition is not stored in execution
    destination = (ActivityImpl) execution.getActivity();
  } else {
    destination = transition.getDestination();
  }    
  ActivityImpl activity = (ActivityImpl) execution.getActivity();
  if (activity!=destination) {
    ActivityImpl nextScope = AtomicOperationTransitionNotifyListenerTake.findNextScope(activity, destination);
    execution.setActivity(nextScope);
    execution.performOperation(TRANSITION_CREATE_SCOPE);
  } else {
    execution.setTransition(null);
    execution.setActivity(destination);
    execution.performOperation(ACTIVITY_EXECUTE);
  }
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:21,代码来源:AtomicOperationTransitionNotifyListenerStart.java

示例6: parseBPMNEdge

import org.activiti.engine.impl.pvm.process.TransitionImpl; //导入依赖的package包/类
public void parseBPMNEdge(Element bpmnEdgeElement, ProcessDefinitionEntity processDefinition) {
  String sequenceFlowId = bpmnEdgeElement.attribute("bpmnElement");
  if (sequenceFlowId != null && !"".equals(sequenceFlowId)) {
    TransitionImpl sequenceFlow = sequenceFlows.get(sequenceFlowId);
    if (sequenceFlow != null) {
      List<Element> waypointElements = bpmnEdgeElement.elementsNS(BpmnParser.OMG_DI_NS, "waypoint");
      if (waypointElements.size() >= 2) {
        List<Integer> waypoints = new ArrayList<Integer>();
        for (Element waypointElement : waypointElements) {
          waypoints.add(parseDoubleAttribute(waypointElement, "x", waypointElement.attribute("x"), true).intValue());
          waypoints.add(parseDoubleAttribute(waypointElement, "y", waypointElement.attribute("y"), true).intValue());
        }
        sequenceFlow.setWaypoints(waypoints);
      } else {
        addError("Minimum 2 waypoint elements must be definted for a 'BPMNEdge'", bpmnEdgeElement);
      }
    } else {
      addError("Invalid reference in 'bpmnElement' attribute, sequenceFlow " + sequenceFlowId + "not found", bpmnEdgeElement);
    }
  } else {
    addError("'bpmnElement' attribute is required on BPMNEdge", bpmnEdgeElement);
  }
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:24,代码来源:BpmnParse.java

示例7: findParallelGatewayId

import org.activiti.engine.impl.pvm.process.TransitionImpl; //导入依赖的package包/类
public String findParallelGatewayId(ActivityImpl activityImpl) {  
    List<PvmTransition> incomingTransitions = activityImpl  
            .getOutgoingTransitions();  
    for (PvmTransition pvmTransition : incomingTransitions) {  
        TransitionImpl transitionImpl = (TransitionImpl) pvmTransition;  
        activityImpl = transitionImpl.getDestination();  
        String type = (String) activityImpl.getProperty("type");  
        if ("parallelGateway".equals(type)) {// 并行路线  
            String gatewayId = activityImpl.getId();  
            String gatewayType = gatewayId.substring(gatewayId  
                    .lastIndexOf("_") + 1);  
            if ("END".equals(gatewayType.toUpperCase())) {  
                return gatewayId.substring(0, gatewayId.lastIndexOf("_"))  
                        + "_start";  
            }  
        }  
    }  
    return null;  
}
 
开发者ID:v5developer,项目名称:maven-framework-project,代码行数:20,代码来源:ActivitiWorkFlowServiceImpl.java

示例8: findParallelGatewayId

import org.activiti.engine.impl.pvm.process.TransitionImpl; //导入依赖的package包/类
/** 
 * 根据当前节点,查询输出流向是否为并行终点,如果为并行终点,则拼装对应的并行起点ID 
 *  
 * @param activityImpl 
 *            当前节点 
 * @return 
 */  
private static String findParallelGatewayId(ActivityImpl activityImpl) {  
    List<PvmTransition> incomingTransitions = activityImpl  
            .getOutgoingTransitions();  
    for (PvmTransition pvmTransition : incomingTransitions) {  
        TransitionImpl transitionImpl = (TransitionImpl) pvmTransition;  
        activityImpl = transitionImpl.getDestination();  
        String type = (String) activityImpl.getProperty("type");  
        if ("parallelGateway".equals(type)) {// 并行路线  
            String gatewayId = activityImpl.getId();  
            String gatewayType = gatewayId.substring(gatewayId  
                    .lastIndexOf("_") + 1);  
            if ("END".equals(gatewayType.toUpperCase())) {  
                return gatewayId.substring(0, gatewayId.lastIndexOf("_"))  
                        + "_start";  
            }  
        }  
    }  
    return null;  
}
 
开发者ID:v5developer,项目名称:maven-framework-project,代码行数:27,代码来源:ProcessCustomService.java

示例9: turnTransition

import org.activiti.engine.impl.pvm.process.TransitionImpl; //导入依赖的package包/类
/** 
 * 流程转向操作 
 *  
 * @param taskId 
 *            当前任务ID 
 * @param activityId 
 *            目标节点任务ID 
 * @param variables 
 *            流程变量 
 * @throws Exception 
 */  
private static void turnTransition(String taskId, String activityId,  
        Map<String, Object> variables) throws Exception {  
    // 当前节点  
    ActivityImpl currActivity = findActivitiImpl(taskId, null);  
    // 清空当前流向  
    List<PvmTransition> oriPvmTransitionList = clearTransition(currActivity);  
  
    // 创建新流向  
    TransitionImpl newTransition = currActivity.createOutgoingTransition();  
    // 目标节点  
    ActivityImpl pointActivity = findActivitiImpl(taskId, activityId);  
    // 设置新流向的目标节点  
    newTransition.setDestination(pointActivity);  
  
    // 执行转向任务  
    taskService.complete(taskId, variables);  
    // 删除目标节点新流入  
    pointActivity.getIncomingTransitions().remove(newTransition);  
  
    // 还原以前流向  
    restoreTransition(currActivity, oriPvmTransitionList);  
}
 
开发者ID:v5developer,项目名称:maven-framework-project,代码行数:34,代码来源:ProcessCustomService.java

示例10: parseBPMNEdge

import org.activiti.engine.impl.pvm.process.TransitionImpl; //导入依赖的package包/类
public void parseBPMNEdge(Element bpmnEdgeElement) {
  String bpmnElementId = bpmnEdgeElement.attribute("bpmnElement");
  if (bpmnElementId != null && !"".equals(bpmnElementId)) {
    TransitionImpl sequenceFlow = sequenceFlows.get(bpmnElementId);
    PhysicalAssociation physicalAssociation = physicalAssociations.get(bpmnElementId);
    AbstractDataAssociation dataAssociation = dataAssociations.get(bpmnElementId);
    if (sequenceFlow != null) {
      parseWaypoints(bpmnEdgeElement, sequenceFlow);
    } else if(null != physicalAssociation) {
      parseWaypoints(bpmnEdgeElement, physicalAssociation);
    } else if(null != dataAssociation) {
      parseWaypoints(bpmnEdgeElement, dataAssociation);
    } else if(!elementIds.contains(bpmnElementId)) { // it might not be a sequenceFlow but it might still reference 'something'
      addError("Invalid reference in 'bpmnElement' attribute; SequenceFlow, MessageFlow, or DataAssociation " + bpmnElementId + " not found", bpmnEdgeElement);
    }
  } else {
    addError("'bpmnElement' attribute is required on BPMNEdge", bpmnEdgeElement);
  }
}
 
开发者ID:iotsap,项目名称:FiWare-Template-Handler,代码行数:20,代码来源:BpmnParse.java

示例11: turnTransition

import org.activiti.engine.impl.pvm.process.TransitionImpl; //导入依赖的package包/类
/**
 * 流程转向操作
 * @param taskId 当前任务ID
 * @param activityId 目标节点任务ID
 * @param variables  流程变量
 * @throws Exception
 */
private void turnTransition(String taskId,String activityId,Map<String,Object> variables)throws Exception{
    //当前节点
    ActivityImpl currActivity = findActivitiImpl(taskId,null);
    //清空当前流向
    List<PvmTransition> oriPvmTransitionList =  clearTransition(currActivity);

    //创建新流向
    TransitionImpl newTransition = currActivity.createOutgoingTransition();

    //目标节点
    ActivityImpl pointActivity = findActivitiImpl(taskId,activityId);

    //设置新流向的目标节点
    newTransition.setDestination(pointActivity);

    //执行转向任务
    taskService.complete(taskId,variables);

    //删除目标节点新流入
    pointActivity.getIncomingTransitions().remove(newTransition);

}
 
开发者ID:ameizi,项目名称:activiti-demo,代码行数:30,代码来源:ProcessExtensionServiceImpl.java

示例12: findParallelGatewayId

import org.activiti.engine.impl.pvm.process.TransitionImpl; //导入依赖的package包/类
/**
 * 根据当前节点,查询输出流向是否为并行终点,如果为并行终点,则拼装对应的并行起点ID
 * @param activityImpl   当前节点
 * @return
 */
private String findParallelGatewayId(ActivityImpl activityImpl){
    List<PvmTransition> incomingTransitions = activityImpl.getOutgoingTransitions();

    for(PvmTransition pvmTransition : incomingTransitions){
        TransitionImpl transitionImpl = (TransitionImpl)pvmTransition;
        activityImpl = transitionImpl.getDestination();
        String type = (String)activityImpl.getProperty("type");
        if("parallelGateway".equals(type)){ //并行路线
            String gatewayId = activityImpl.getId();
            String gettewayType = gatewayId.substring(gatewayId.lastIndexOf("_")+1);
            if("END".equals(gettewayType.toUpperCase())){
                return gatewayId.substring(0, gatewayId.lastIndexOf("_"))+"_start";
            }
        }
    }

    return null;
}
 
开发者ID:ameizi,项目名称:activiti-demo,代码行数:24,代码来源:ProcessExtensionServiceImpl.java

示例13: buildProcessDefinition

import org.activiti.engine.impl.pvm.process.TransitionImpl; //导入依赖的package包/类
public PvmProcessDefinition buildProcessDefinition() {
    for (Object[] unresolvedTransition : unresolvedTransitions) {
        TransitionImpl transition = (TransitionImpl) unresolvedTransition[0];
        String destinationActivityName = (String) unresolvedTransition[1];
        ActivityImpl destination = processDefinition.findActivity(destinationActivityName);
        if (destination == null) {
            throw new ActivitiException("destination '" + destinationActivityName + "' not found.  (referenced from transition in '" + transition.getSource().getId() + "')");
        }
        transition.setDestination(destination);
    }
    return processDefinition;
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:13,代码来源:ProcessDefinitionBuilder.java

示例14: take

import org.activiti.engine.impl.pvm.process.TransitionImpl; //导入依赖的package包/类
@Override
public void take(PvmTransition transition) {
    if (this.transition != null) {
        throw new PvmException("already taking a transition");
    }
    if (transition == null) {
        throw new PvmException("transition is null");
    }
    setTransition((TransitionImpl) transition);
    performOperation(AtomicOperation.TRANSITION_NOTIFY_LISTENER_END);
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:12,代码来源:ExecutionImpl.java

示例15: setTransition

import org.activiti.engine.impl.pvm.process.TransitionImpl; //导入依赖的package包/类
@Override
public void setTransition(TransitionImpl transition) {
    this.transition = transition;
    if (replacedBy != null) {
        replacedBy.setTransition(transition);
    }
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:8,代码来源:ExecutionEntity.java


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