• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java TransitionImpl类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: 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 RuntimeException("destination '"+destinationActivityName+"' not found.  (referenced from transition in '"+transition.getSource().getId()+"')");
    }
    transition.setDestination(destination);
  }
  return processDefinition;
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:13,代码来源:ProcessDefinitionBuilder.java


示例17: take

import org.activiti.engine.impl.pvm.process.TransitionImpl; //导入依赖的package包/类
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:logicalhacking,项目名称:SecureBPMN,代码行数:11,代码来源:ExecutionImpl.java


示例18: take

import org.activiti.engine.impl.pvm.process.TransitionImpl; //导入依赖的package包/类
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");
  }
  setActivity((ActivityImpl)transition.getSource());
  setTransition((TransitionImpl) transition);
  performOperation(AtomicOperation.TRANSITION_NOTIFY_LISTENER_END);
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:12,代码来源:ExecutionEntity.java


示例19: parseProcess

import org.activiti.engine.impl.pvm.process.TransitionImpl; //导入依赖的package包/类
/**
 * Parses one process (ie anything inside a &lt;process&gt; element).
 * 
 * @param processElement
 *          The 'process' element.
 * @return The parsed version of the XML: a {@link ProcessDefinitionImpl}
 *         object.
 */
public ProcessDefinitionEntity parseProcess(Element processElement) {
  // reset all mappings that are related to one process definition
  sequenceFlows = new HashMap<String, TransitionImpl>();

  ProcessDefinitionEntity processDefinition = new ProcessDefinitionEntity();

  /*
   * Mapping object model - bpmn xml: processDefinition.id -> generated by
   * activiti engine processDefinition.key -> bpmn id (required)
   * processDefinition.name -> bpmn name (optional)
   */
  processDefinition.setKey(processElement.attribute("id"));
  processDefinition.setName(processElement.attribute("name"));
  processDefinition.setCategory(rootElement.attribute("targetNamespace"));
  processDefinition.setProperty(PROPERTYNAME_DOCUMENTATION, parseDocumentation(processElement));
  processDefinition.setTaskDefinitions(new HashMap<String, TaskDefinition>());
  processDefinition.setDeploymentId(deployment.getId());

  if (LOGGER.isLoggable(Level.FINE)) {
    LOGGER.fine("Parsing process " + processDefinition.getKey());
  }
  parseScope(processElement, processDefinition);

  for (BpmnParseListener parseListener : parseListeners) {
    parseListener.parseProcess(processElement, processDefinition);
  }

  return processDefinition;
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:38,代码来源:BpmnParse.java


示例20: parseSequenceFlow

import org.activiti.engine.impl.pvm.process.TransitionImpl; //导入依赖的package包/类
/**
 * Parses all sequence flow of a scope.
 * 
 * @param processElement
 *          The 'process' element wherein the sequence flow are defined.
 * @param scope
 *          The scope to which the sequence flow must be added.
 */
public void parseSequenceFlow(Element processElement, ScopeImpl scope) {
  for (Element sequenceFlowElement : processElement.elements("sequenceFlow")) {

    String id = sequenceFlowElement.attribute("id");
    String sourceRef = sequenceFlowElement.attribute("sourceRef");
    String destinationRef = sequenceFlowElement.attribute("targetRef");

    // Implicit check: sequence flow cannot cross (sub) process boundaries: we
    // don't do a processDefinition.findActivity here
    ActivityImpl sourceActivity = scope.findActivity(sourceRef);
    ActivityImpl destinationActivity = scope.findActivity(destinationRef);

    if (sourceActivity != null && destinationActivity != null) {

      TransitionImpl transition = sourceActivity.createOutgoingTransition(id);
      sequenceFlows.put(id, transition);
      transition.setProperty("name", sequenceFlowElement.attribute("name"));
      transition.setProperty("documentation", parseDocumentation(sequenceFlowElement));
      transition.setDestination(destinationActivity);
      parseSequenceFlowConditionExpression(sequenceFlowElement, transition);
      parseExecutionListenersOnTransition(sequenceFlowElement, transition);

      for (BpmnParseListener parseListener : parseListeners) {
        parseListener.parseSequenceFlow(sequenceFlowElement, scope, transition);
      }

    } else if (sourceActivity == null) {
      addError("Invalid source '" + sourceRef + "' of sequence flow '" + id + "'", sequenceFlowElement);
    } else if (destinationActivity == null) {
      addError("Invalid destination '" + destinationRef + "' of sequence flow '" + id + "'", sequenceFlowElement);
    }

  }
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:43,代码来源:BpmnParse.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Instruction21s类代码示例发布时间:2022-05-22
下一篇:
Java EntryWeigher类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap