Package org.huihoo.workflow.xpdl

Examples of org.huihoo.workflow.xpdl.WorkflowTransition


    String caseId = dispWork.getWorkflowCase().getUUID();

    int size = falseTransitions.size();
    for (int i = 0; i < size; ++i)
    {
      WorkflowTransition falseTransition = (WorkflowTransition) falseTransitions.get(i);
      WorkflowActivity falseActivity = falseTransition.getToWorkflowActivity();
      WorkflowTransition falseJoinTransition = null;

      while (falseActivity != null)
      {
        if (falseActivity.getUUID().equals(orJoinActivity.getUUID()))
        {
          falseJoinTransition = falseTransition;
          break;
        }

        swap_falseTransitions = falseActivity.getOutgoingTransitions();
        if (swap_falseTransitions == null || swap_falseTransitions.size() == 0)
        {
          break;
        }
        else
        {
          falseTransition = ((WorkflowTransition) swap_falseTransitions.get(0));
          falseActivity = nextPossibleActivityFinder(falseActivity, swap_falseTransitions);
        }
      } //while (falseActivity != null)

      log.debug("falseJoinTransition : " + falseJoinTransition.getInfo());

      if (falseJoinTransition != null)
      {
        //OR-JOIN Activity found,set false falseJoinActivity#vc_disp_flag
        //insert into database table(rt_p_activity_dispatch)
        //@see  database table(rt_p_activity_dispatch)
       
        WorkflowActivity ins_falseActivity = falseJoinTransition.getFromWorkflowActivity();
        String ins_falseActivityId = ins_falseActivity.getUUID();
        String ins_owner_processid = ins_falseActivity.getWorkflowProcess().getUUID();

        PreparedStatement pstmt = null;
        String strSQL = null;
View Full Code Here


      if (activity_dispatch_transition_id != null)
      {
        log.debug("[" + fromActivity + "] select  or-join-transition by attribute '"+XPDLGlobals.ACTIVITY_DISPATCH_TRANSITION_ID+"'");
        WorkflowProcess activity_owner_process = fromActivity.getWorkflowProcess();
        WorkflowTransition transition = activity_owner_process.findWorkflowTransition(activity_dispatch_transition_id);
        joinActivity = transition.getToWorkflowActivity();
      }
      else
      {
        log.debug("[" + fromActivity + "] select first transition as or-join-transition");
        joinActivity = ((WorkflowTransition) outTransitions.get(0)).getToWorkflowActivity();
View Full Code Here

    {
      WorkflowProcess workflowProcess = (WorkflowProcess) processList.get(i);
      List trans = workflowProcess.getWorkflowTransitions();
      int trans_size = trans.size();

      WorkflowTransition tran = null;

      for (int j = 0; j < trans_size; ++j)
      {
        tran = (WorkflowTransition) trans.get(j);
        if (tran.getFromWorkflowActivity() == null)
        {
          errorList.add(
            new WorkflowException(
              "Transition attribute 'From' must be set.{packageID="
                + workflowPackage.getUUID()
                + ",processID="
                + workflowProcess.getUUID()
                + ",transitionID="
                + tran.getUUID()
                + "}"));
        }

        if (tran.getToWorkflowActivity() == null)
        {
          errorList.add(
            new WorkflowException(
              "Transition attribute 'To' must be set.{packageID="
                + workflowPackage.getUUID()
                + ",processID="
                + workflowProcess.getUUID()
                + ",transitionID="
                + tran.getUUID()
                + "}"));
        }
      }
    }
View Full Code Here

    for (int i = 0; i < process_size; ++i)
    {
      WorkflowProcess workflowProcess = (WorkflowProcess) processList.get(i);
      List transitions = workflowProcess.getWorkflowTransitions();
      int tran_size = transitions.size();
      WorkflowTransition transition = null;
      WorkflowActivity fromActivity = null;
      WorkflowActivity toActivity = null;
      for (int j = 0; j < tran_size; ++j)
      {
        transition = (WorkflowTransition) transitions.get(j);

        fromActivity = transition.getFromWorkflowActivity();
        toActivity = transition.getToWorkflowActivity();
        if (fromActivity != null)
        {
          fromActivity.addOutgoingTransition(transition);
        }
        //        else
        //        {
        //          System.err.println("transition=" + transition.getUUID() + ",from=<null>");
        //        }
        if (toActivity != null)
        {
          toActivity.addIncomingTransition(transition);
        }
        //        else
        //        {
        //          System.err.println("transition=" + transition.getUUID() + ",to=<null>");
        //        }
      }
    }

    //  ---------------------------------------------------------------
    //   2. format transition condition
    //  --------------------------------------------------------------- 
    for (int i = 0; i < process_size; ++i)
    {
      WorkflowProcess workflowProcess = (WorkflowProcess) processList.get(i);
      List transitions = workflowProcess.getWorkflowTransitions();
      int tran_size = transitions.size();
      WorkflowTransition transition = null;

      for (int j = 0; j < tran_size; ++j)
      {
        transition = (WorkflowTransition) transitions.get(j);
        WorkflowCondition condition = transition.getCondition();
        if (condition != null && condition.getContent() != null)
        {
          ExtendedAttribute attribute = transition.findExtendedAttribute(XPDLGlobals.CONDITION_TYPE);
          if (attribute != null)
          {
            ConditionType ctype = ConditionType.parse(attribute.getValue());
            if (ConditionType.CONDITION_SCRIPT.equals(ctype))
            {
              transition.setCondition(new ScriptCondition(condition.getContent()));
            }

            transition.removeExtendedAttribute(XPDLGlobals.CONDITION_TYPE);
          }
        }
      }
    }
View Full Code Here

    this.packageID=workflowProcess.getWorkflowPackage().getUUID();
    this.attributes=workflowProcess.getExtendedAttributes();
   
    this.processHeader=workflowProcess.getProcessHeader();
   
    WorkflowTransition target = null;
    for (int i = 0; i < workflowProcess.getWorkflowTransitions().size(); ++i)
    {
      target = (WorkflowTransition) workflowProcess.getWorkflowTransitions().get(i);
      transitions.add(new SerialTransition(target));
    }
View Full Code Here

    WorkflowCaseContext caseContext = workflowCase.getCaseContext();

    int sizeTrans = transList.size();
    if (sizeTrans > 0)
    {
      WorkflowTransition transition = null;

      for (int i = 0; i < sizeTrans; ++i)
      {
        if (context != null)
        {
          context.clear();
        }
        transition = (WorkflowTransition) transList.get(i);
        context = genParameterConext(caseContext, transition);

        WorkflowCondition conditon = transition.getCondition();
        if (conditon == null)
        {
          log.debug("[filterOutTransition_xorSplit] ACCEPT transition:" + transition.getInfo() + " | condition: " + conditon);
          outTrans.add(transition);
          break;
        }
        else
        {
          if (interpretor.evalute(workflowWork, transition, context))
          {
            log.debug("[filterOutTransition_xorSplit] ACCEPT transition:" + transition.getInfo() + " | condition: " + conditon);
            try
            {
              updateContext(workflowProcess, operator, caseDatabase, userTransaction, context, caseContext, false);
            }
            catch (Throwable ex)
            {
              throw new WorkflowException(ex);
            }
            outTrans.add(transition);
            break;
          }
          else
          {
            log.debug("[filterOutTransition_xorSplit] REJECT transition:" + transition.getInfo() + " | condition: " + conditon);
          }
        }

      } //~end for (int i = 0; i < sizeTrans; ++i)
View Full Code Here

    List rejectTrans = new ArrayList();

    int sizeTrans = transList.size();
    if (sizeTrans > 0)
    {
      WorkflowTransition transition = null;

      for (int i = 0; i < sizeTrans; ++i)
      {
        if (context != null)
        {
          context.clear();
        }
       
        transition = (WorkflowTransition) transList.get(i);
        context = genParameterConext(caseContext, transition);

        WorkflowCondition conditon = transition.getCondition();
        if (conditon == null)
        {
          outTrans.add(transition);
          log.debug("[filterOutTransition_orSplit] ACCEPT transition:" + transition.getInfo() + " | condition: " + conditon);
        }
        else
        {
          if (interpretor.evalute(workflowWork, transition, context))
          {
            log.debug("[filterOutTransition_orSplit] ACCEPT transition:" + transition.getInfo() + " | condition: " + conditon);
            try
            {
              updateContext(workflowProcess, operator, caseDatabase, userTransaction, context, caseContext, false);
            }
            catch (Throwable ex)
            {
              throw new WorkflowException(ex);
            }
           
            outTrans.add(transition);
          }
          else
          {
            log.debug("[filterOutTransition_orSplit] REJECT transition:" + transition.getInfo() + " | condition: " + conditon);
            rejectTrans.add(transition);

          } //~end if (interpretor.evalute(workflowWork, transition, context))

        } //~end if (conditon == null)
View Full Code Here

      List not_found_inTrans = new ArrayList();

      for (int i = 0; i < inTrans_size; ++i)
      {
        WorkflowTransition flaseTransition = (WorkflowTransition) inTrans.get(i);
        WorkflowActivity falseActivity = flaseTransition.getFromWorkflowActivity();
        String false_owner_process_id = falseActivity.getWorkflowProcess().getUUID();
        String false_activity_id = falseActivity.getUUID();

        pstmt.setString(1, "FALSE");
        pstmt.setString(2, packageId);
        pstmt.setString(3, processId);
        pstmt.setString(4, caseId);
        pstmt.setString(5, false_owner_process_id);
        pstmt.setString(6, false_activity_id);

        rs = pstmt.executeQuery();
        if (rs.next())
        {
          falseTrans_size += 1;
        }
        else
        {
          not_found_inTrans.add(flaseTransition);
        }
      }
      ConnUtils.cleanupNoThrow(pstmt);
      pstmt = null;
     
      //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
      // -----------------Lookup In event_userTransaction  ---------------------------------
      //------------------VIP Code Section By zosatapo----------------------------------------
      //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ 
      Connection event_conn = null;
      PreparedStatement event_pstmt = null;
      ResultSet  event_rs=null;
      try
      {
        event_conn = (Connection) event_userTransaction.getStoreConnection().get();
       
        strSQL =
          "SELECT  int_batchNo  FROM "+userTransaction.getDatabase().getSchemaContext().getTableName(SchemaContext.SCHEMA_ACTIVITY_DISPATCH)+" "
            + "WHERE  vc_disp_flag=? "
            + "AND    vc_packageid=? "
            + "AND    vc_processid=? "
            + "AND    vc_caseid=?  "
            + "AND    vc_owner_processid=? "
            + "AND    vc_activityid=? ";
        event_pstmt = event_conn.prepareStatement(strSQL);
             
        int not_found_inTrans_size = not_found_inTrans.size();
        for (int i = 0; i < not_found_inTrans_size; ++i)
        {
          WorkflowTransition flaseTransition = (WorkflowTransition) not_found_inTrans.get(i);
          WorkflowActivity falseActivity = flaseTransition.getFromWorkflowActivity();
          String false_owner_process_id = falseActivity.getWorkflowProcess().getUUID();
          String false_activity_id = falseActivity.getUUID();

          event_pstmt.setString(1, "FALSE");
          event_pstmt.setString(2, packageId);
View Full Code Here

      else
      {
        //destination  instanceAndJoin activity all in-transitions
        //ONLY ==ONE== in-transition
        List inTrans = joinActivity.getIncomingTransitions();
        WorkflowTransition tempTrans = (WorkflowTransition) inTrans.get(0);

        strSQL =
          "SELECT count(*)  FROM "
            + caseDatabase.getSchemaContext().getTableName(SchemaContext.SCHEMA_PATH)
            + " "
            + "WHERE  vc_packageid=? "
            + "AND    vc_processid=? "
            + "AND    vc_caseid=?  "
            + "AND    vc_owner_processid=?  "
            + "AND    vc_transitionid=? "
            + "AND    vc_to=? ";
        pstmt = conn.prepareStatement(strSQL);
        pstmt.setString(1, packageId);
        pstmt.setString(2, processId);
        pstmt.setString(3, caseId);
        pstmt.setString(4, tempTrans.getWorkflowProcess().getUUID());
        pstmt.setString(5, tempTrans.getUUID());
        pstmt.setString(6, join_work_id);
        rs = pstmt.executeQuery();
        join_monitor_counter = rs.getInt(1);
      }

View Full Code Here

    WorkflowProcess workflowProcess=workflowActivity.getWorkflowProcess();
    this.packageID=workflowProcess.getWorkflowPackage().getUUID();
    this.processID=workflowProcess.getUUID();
   
    List wfo_inTransitions=workflowActivity.getIncomingTransitions();
    WorkflowTransition transition=null;
   
    for(int i=0;i<wfo_inTransitions.size();++i)
    {
      transition=(WorkflowTransition)wfo_inTransitions.get(i);
      inTransitions.add(transition.getUUID());
    }
 
    List wfo_outTransitions=workflowActivity.getOutgoingTransitions();
   
    for(int i=0;i<wfo_outTransitions.size();++i)
    {
      transition=(WorkflowTransition)wfo_outTransitions.get(i);
      outTransitions.add(transition.getUUID());
    }
     
    this.performerType=workflowActivity.getPerformerType();
    this.joinType=workflowActivity.getJoinType();
    this.activityType=workflowActivity.getActivityType();
View Full Code Here

TOP

Related Classes of org.huihoo.workflow.xpdl.WorkflowTransition

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.