Package org.eclipse.uml2

Examples of org.eclipse.uml2.Activity


    for (FlowElement flowElement : flowElementList) {
      if (attachedToRefId.equals(flowElement.getId())) {
        return (Activity) flowElement;
      } else if (flowElement instanceof SubProcess) {
        SubProcess subProcess = (SubProcess) flowElement;
        Activity activity = retrieveAttachedRefObject(attachedToRefId, subProcess.getFlowElements());
        if (activity != null) {
          return activity;
        }
      }
    }
View Full Code Here


   
    if(nodeId==null){
      Event event=(Event)tokenEntity.getFlowNode();
      if(event instanceof BoundaryEvent){
        BoundaryEvent boundaryEvent=(BoundaryEvent)event;
        Activity activity =boundaryEvent.getAttachedToRef();
        boolean isCancelActivity=boundaryEvent.isCancelActivity();
        if(isCancelActivity){
          //如果是终止事件 则结束进入节点的时候的散发的所有子令牌 然后将父令牌 移动到超时节点往下进行
          tokenEntity.signalKillChildMoveParentToken(boundaryEvent,activity);
        }
        else{
          //如果不是终止事件 则默认方法驱动令牌
          tokenEntity.signal();
        }
       
      }
      if(event instanceof CatchEvent){
        tokenEntity.signal();
      }
     
    }
    else{
      BaseElement baseElement=processDefinition.getDefinitions().getElement(nodeId);
      if(baseElement instanceof BoundaryEvent){
        BoundaryEvent boundaryEvent=(BoundaryEvent)baseElement;
        Activity activity =boundaryEvent.getAttachedToRef();
       
        //String nodeTokenId = this.getId();
        // 创建分支令牌并添加到集合中
        boolean isCancelActivity=boundaryEvent.isCancelActivity();
        if(isCancelActivity){
View Full Code Here

    if (sequenceFlow.getConditionExpression() != null) {
      line.setLineType(LineType.ConditionalFlow);
    }

    if (sequenceFlow.getTargetRef() instanceof Activity) {
      Activity activity = (Activity) sequenceFlow.getTargetRef();
      if (activity.getDefault() != null && activity.getDefault().equals(sequenceFlow)) {
        line.setLineType(LineType.DefaultFlow);
      }
    }

    if (sequenceFlow.getTargetRef() instanceof Gateway) {
View Full Code Here

    // 执行下一个节点的进入事件
   
    if(targetRef instanceof Activity)
    {
      Activity activity=(Activity)targetRef;
      if(activity.getLoopCharacteristics()!=null&&activity.getLoopCharacteristics() instanceof MultiInstanceLoopCharacteristics)
      {
        targetRef.enter(executionContext);
      }
      else
      {
View Full Code Here

    } else if (STENCIL_EVENT_BOUNDARY_SIGNAL.equals(stencilId)) {
      boundaryEvent.setCancelActivity(getPropertyValueAsBoolean(PROPERTY_CANCEL_ACTIVITY, elementNode));
      convertJsonToSignalDefinition(elementNode, boundaryEvent);
    }
   
    Activity activityRef=BpmnModelUtil.getElement(model, lookForAttachedRef(elementNode.get(EDITOR_SHAPE_ID).asText(), modelNode.get(EDITOR_CHILD_SHAPES)),Activity.class);
   
    boundaryEvent.setAttachedToRef(activityRef);
    return boundaryEvent;
  }
View Full Code Here

            getParent().end();
          }
        } else {
          // 子流程多实例的时候 每个子流程结束的时候去触发验证完成条件
          if (getParent().getFlowNode() instanceof Activity) {
            Activity activity = (Activity) getParent().getFlowNode();
            LoopCharacteristics loopCharacteristics = activity.getLoopCharacteristics();
            if (loopCharacteristics instanceof MultiInstanceLoopCharacteristics) {
              if (this.isSubProcessRootToken) {
                if (!getParent().hasEnded()) {
                  getParent().signal();
                }
View Full Code Here

    // 用于并行、串行会签的处理.
   
    //在离开节点的时候判断多实例
    if (this instanceof Activity && ((Activity) this).getLoopCharacteristics() != null) {
     
      Activity activity = (Activity) this;
     
      LoopCharacteristics loopCharacteristics = activity.getLoopCharacteristics();
     
      // 如果是并行多实例
      if (loopCharacteristics instanceof MultiInstanceLoopCharacteristics) {
        // 并行多实例处理
       
        //MultiInstanceLoopCharacteristics multiInstanceLoopCharacteristics = (MultiInstanceLoopCharacteristics) loopCharacteristics;

       
        TokenEntity token=executionContext.getToken();
       
        LOG.debug("节点: {}({}) 含有并行多实例,将进入多实例'离开'阶段处理,令牌号: {}({}).",activity.getName(),activity.getId(),token.getName(),token.getId());
       
       
       
        // 输出数据集
        String loopDataOutputCollectionExpressionValue = getLoopDataOutputCollectionExpression();
       
        // 多实例输入数据集
        String loopDataInputCollectionExpressionValue = getLoopDataInputCollectionExpression();
       
        // 多实例输入项
        String inputDataItemExpressionValue = getInputDataItemExpression();
       
        // 多实例输出项
        String outputDataItemExpressionValue = getOutputDataItemExpression();
       
        //完成条件
        String completionConditionExpressionValue=getCompletionConditionExpression();
       
        //打印日志信息
        LOG.debug("\n多实例配置信息: \n 【输入数据集】: \n{}",loopDataInputCollectionExpressionValue);
       
        LOG.debug("\n【输入项编号】: \n{}",inputDataItemExpressionValue);
       
        LOG.debug("\n【输出项编号】: \n{}",outputDataItemExpressionValue)
       
        LOG.debug("\n【输出数据集】: \n{}",outputDataItemExpressionValue)
       
        LOG.debug("\n【完成条件】: \n{}",completionConditionExpressionValue)
       

        if (loopDataOutputCollectionExpressionValue != null && !loopDataOutputCollectionExpressionValue.equals("")) {

          Object valueObj = ExpressionMgmt.execute(loopDataOutputCollectionExpressionValue, executionContext);

          if (valueObj != null) {

            if (valueObj instanceof Collection) {

              String expressionValueTemp = getOutputDataItemExpression();

              @SuppressWarnings("rawtypes")
              Collection collection = (Collection) valueObj;
              collection.add(ExpressionMgmt.execute(expressionValueTemp, executionContext));

            } else {

            }
          } else {

          }
        }

       
       
        if (completionConditionExpressionValue == null || completionConditionExpressionValue.equals("")) {

          LOG.error("节点: "+activity.getName()+"("+activity.getId()+") 多实例完成条件为空.");
         
          throw new FixFlowExpressionException(ExceptionCode.EXPRESSIONEXCEPTION_CONDITIONEXPRESSIONEMPTY,this.getId(),this.getName(),"");
         
        } else {
         
          boolean isCompletion=false;
          try {
           
            isCompletion=StringUtil.getBoolean(ExpressionMgmt.execute(completionConditionExpressionValue, executionContext));
           
          } catch (Exception e) {
           
            LOG.error("节点: "+activity.getName()+"("+activity.getId()+") 多实例完成条件计算出错.",e);
            throw new FixFlowExpressionException(ExceptionCode.EXPRESSIONEXCEPTION_CONDITIONEXPRESSIONERROR,this.getId(),this.getName(),"");
           
          }
         
          if (isCompletion){
           
            LOG.debug("节点: {}({}) 多实例完成条件验证通过,令牌号: {}({}).",activity.getName(),activity.getId(),token.getName(),token.getId());
           
           
            super.leave(executionContext);
           
          }else{
            //不做处理
            LOG.debug("节点: {}({}) 多实例完成条件验证不通过,令牌将继续停留在当前借点,令牌号: {}({}).",activity.getName(),activity.getId(),token.getName(),token.getId());
          }
        }

      } else {
        //这里还没实现。。。。囧
View Full Code Here

     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public void setActivityRef(Activity newActivityRef) {
        Activity oldActivityRef = activityRef;
        activityRef = newActivityRef;
        if (eNotificationRequired())
            eNotify(new ENotificationImpl(this, Notification.SET,
                    Bpmn2Package.COMPENSATE_EVENT_DEFINITION__ACTIVITY_REF, oldActivityRef,
                    activityRef));
View Full Code Here

    // debugLog.debug("节点 "+getId()+" 执行跳过处理!");
  }

  protected void loopExecute(ExecutionContext executionContext) {
   
    Activity activity = (Activity) this;
   
    TokenEntity token=executionContext.getToken();
   
    //获取 Activity 的多实例信息
    LoopCharacteristics loopCharacteristics = activity.getLoopCharacteristics();
   
    //判断事都是并行多实例
    if (loopCharacteristics instanceof MultiInstanceLoopCharacteristics) {
     
      // 并行多实例处理
      LOG.debug("节点: {}({}) 含有并行多实例,将进入多实例'进入'阶段处理,令牌号: {}({}).",activity.getName(),activity.getId(),token.getName(),token.getId());
     
      // 输出数据集
      String loopDataOutputCollectionExpressionValue = getLoopDataOutputCollectionExpression();
     
      // 多实例输入数据集
View Full Code Here

  @Override
  public IDeleteFeature getDeleteFeature(IFeatureProvider fp) {
    return new AbstractDefaultDeleteFeature(fp) {
      @Override
      public void delete(final IDeleteContext context) {
        Activity activity = BusinessObjectUtil.getFirstElementOfType(context.getPictogramElement(),
            Activity.class);
        new AbstractBoundaryEventOperation() {
          @Override
          protected void doWorkInternal(ContainerShape container) {
            IDeleteContext delete = new DeleteContext(container);
View Full Code Here

TOP

Related Classes of org.eclipse.uml2.Activity

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.