Package org.huihoo.workflow.xpdl

Examples of org.huihoo.workflow.xpdl.WorkflowActivity


    WorkflowParticipant operator,
    UserTransaction event_userTransaction,
    WorkflowWork workflowWork,
    WorkflowTransition workflowTransition)
  {
    WorkflowActivity joinActivity = workflowTransition.getToWorkflowActivity();
    JoinType joinType = joinActivity.getJoinType();
    if (joinType != null)
    {
      CaseDatabaseImpl caseDatabaseImpl = (CaseDatabaseImpl) workflowService.getCaseDatabase();
      SpiCaseDatabase caseDatabase = caseDatabaseImpl.getWrappedObject();
View Full Code Here


    UserTransaction userTransaction,
    WorkflowWork workflowWork,
    WorkflowTransition workflowTransition)
  {
    WorkflowCase workflowCase = workflowWork.getWorkflowCase();
    WorkflowActivity dispActivity = workflowTransition.getFromWorkflowActivity();
    String disp_owner_process_id = dispActivity.getWorkflowProcess().getUUID();
    String disp_activity_id = dispActivity.getUUID();

    String packageId = workflowProcess.getWorkflowPackage().getUUID();
    String processId = workflowProcess.getUUID();
    String caseId = workflowCase.getUUID();

    WorkflowActivity joinActivity = workflowTransition.getToWorkflowActivity();
    String join_owner_process_id = joinActivity.getWorkflowProcess().getUUID();
    String join_activity_id = joinActivity.getUUID();

    Connection conn = (Connection) userTransaction.getStoreConnection().get();
    PreparedStatement pstmt = null;
    ResultSet rs = null;
    String strSQL = null;

    MonitorEventResult eventResult = new MonitorEventResult();

    try
    {
      //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
      int join_monitor_counter = 0;
      int join_activity_batchNo = 0;
      int disp_activity_batchNo = 0;

      //--------------------------------------------------------------------
      // DISP ACTIVITY DISPATCH INFO
      // 1. ȡ�ñ����ɷ��Ĺ������������Ļ�ڵ���Ϣ
      //--------------------------------------------------------------------
      strSQL =
        "SELECT  int_batchNo,int_join_monitor  FROM "+userTransaction.getDatabase().getSchemaContext().getTableName(SchemaContext.SCHEMA_ACTIVITY_DISPATCH)+"  "
          + "WHERE  vc_packageid=? "
          + "AND    vc_processid=? "
          + "AND    vc_caseid=?  "
          + "AND    vc_owner_processid=? "
          + "AND    vc_activityid=? ";

      pstmt = conn.prepareStatement(strSQL);
      pstmt.setString(1, packageId);
      pstmt.setString(2, processId);
      pstmt.setString(3, caseId);
      pstmt.setString(4, disp_owner_process_id);
      pstmt.setString(5, disp_activity_id);

      rs = pstmt.executeQuery();
      if (rs.next())
      {
        disp_activity_batchNo = rs.getInt("int_batchNo");
        eventResult.setBatchNo(disp_activity_batchNo);
      }
      else
      {
        eventResult.setBatchNo(disp_activity_batchNo);
      }
      //--------------------------------------------------------------------
      // JOIN ACTIVITY DISPATCH INFO
      // 2.ȡ�ù��������۵Ļ�ڵ���Ϣ
      //--------------------------------------------------------------------
      pstmt.setString(1, packageId);
      pstmt.setString(2, processId);
      pstmt.setString(3, caseId);
      pstmt.setString(4, join_owner_process_id);
      pstmt.setString(5, join_activity_id);

      rs = pstmt.executeQuery();
      if (rs.next())
      {
        join_activity_batchNo = rs.getInt("int_batchNo");
        join_monitor_counter = rs.getInt("int_join_monitor");
      }

      ConnUtils.cleanupNoThrow(pstmt);
      pstmt = null;

      if ((disp_activity_batchNo + 1) < join_activity_batchNo)
      {
        eventResult.first(false);
        eventResult.last(false);

        return eventResult;
      }

      //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 
      // 3. ȡ�û�۵Ļ�ڵ㵱ǰ��ɵ�ǰ�̹�������Ϣ
      //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
      String join_work_id = null;
      strSQL =
        "SELECT vc_uuid  FROM "
          + caseDatabase.getSchemaContext().getTableName(SchemaContext.SCHEMA_WORK)
          + " "
          + "WHERE  dat_acceptTime IS NULL "
          + "AND    vc_packageid=? "
          + "AND    vc_processid=? "
          + "AND    vc_caseid=?  "
          + "AND    vc_owner_processid=? "
          + "AND    vc_activityid=? ";

      pstmt = conn.prepareStatement(strSQL);
      pstmt.setString(1, packageId);
      pstmt.setString(2, processId);
      pstmt.setString(3, caseId);

      pstmt.setString(4, join_owner_process_id);
      pstmt.setString(5, join_activity_id);

      rs = pstmt.executeQuery();

      if (rs.next())
      {
        eventResult.first(false);
        eventResult.last(false);
        join_work_id = rs.getString("vc_uuid");
      }
      else
      {
        eventResult.first(true);
        eventResult.last(false);
        join_monitor_counter = 0;
      }

      ConnUtils.cleanupNoThrow(pstmt);
      pstmt = null;

      List inTrans = joinActivity.getIncomingTransitions();
      int sizeTrans = inTrans.size();
//      System.err.println("$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$");
//      System.err.println("joinActivity : "+joinActivity);
//      System.err.println(inTrans);
//      System.err.println("join_monitor_counter : "+join_monitor_counter);
View Full Code Here

    WorkflowTransition workflowTransition)
  {
   
    WorkflowCase workflowCase = workflowWork.getWorkflowCase();

    WorkflowActivity dispActivity = workflowTransition.getFromWorkflowActivity();
    String disp_owner_process_id = dispActivity.getWorkflowProcess().getUUID();
    String disp_activity_id = dispActivity.getUUID();

    WorkflowActivity joinActivity = workflowTransition.getToWorkflowActivity();
    String join_owner_process_id = joinActivity.getWorkflowProcess().getUUID();
    String join_activity_id = joinActivity.getUUID();

    String packageId = workflowProcess.getWorkflowPackage().getUUID();
    String processId = workflowProcess.getUUID();
    String caseId = workflowWork.getWorkflowCase().getUUID();
View Full Code Here

    WorkflowTransition workflowTransition)
  {
 
    WorkflowCase workflowCase = workflowWork.getWorkflowCase();

    WorkflowActivity dispActivity = workflowTransition.getFromWorkflowActivity();
    String disp_owner_process_id = dispActivity.getWorkflowProcess().getUUID();
    String disp_activity_id = dispActivity.getUUID();

    WorkflowActivity joinActivity = workflowTransition.getToWorkflowActivity();
    String join_owner_process_id = joinActivity.getWorkflowProcess().getUUID();
    String join_activity_id = joinActivity.getUUID();

    String packageId = workflowProcess.getWorkflowPackage().getUUID();
    String processId = workflowProcess.getUUID();
    String caseId = workflowWork.getWorkflowCase().getUUID();

    Connection conn = (Connection) userTransaction.getStoreConnection().get();
    PreparedStatement pstmt = null;
    ResultSet rs = null;
    String strSQL = null;

    MonitorEventResult eventResult = new MonitorEventResult();

    try
    {
      //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
      int join_monitor_counter = 0;
      int join_activity_batchNo = 0;
      int disp_activity_batchNo = 0;

      //--------------------------------------------------------------------
      // DISP ACTIVITY DISPATCH INFO
      // 1. ȡ�ñ����ɷ��Ĺ������������Ļ�ڵ���Ϣ
      strSQL =
        "SELECT  int_batchNo,int_join_monitor  FROM "+userTransaction.getDatabase().getSchemaContext().getTableName(SchemaContext.SCHEMA_ACTIVITY_DISPATCH)+"  "
          + "WHERE  vc_packageid=? "
          + "AND    vc_processid=? "
          + "AND    vc_caseid=?  "
          + "AND    vc_owner_processid=? "
          + "AND    vc_activityid=? ";

      pstmt = conn.prepareStatement(strSQL);
      pstmt.setString(1, packageId);
      pstmt.setString(2, processId);
      pstmt.setString(3, caseId);
      pstmt.setString(4, disp_owner_process_id);
      pstmt.setString(5, disp_activity_id);

      rs = pstmt.executeQuery();
      if (rs.next())
      {
        disp_activity_batchNo = rs.getInt("int_batchNo");
        eventResult.setBatchNo(disp_activity_batchNo);
      }

      //--------------------------------------------------------------------
      // JOIN ACTIVITY DISPATCH INFO
      // 2.ȡ�ù��������۵Ļ�ڵ���Ϣ
      //--------------------------------------------------------------------
      pstmt.setString(1, packageId);
      pstmt.setString(2, processId);
      pstmt.setString(3, caseId);
      pstmt.setString(4, join_owner_process_id);
      pstmt.setString(5, join_activity_id);

      rs = pstmt.executeQuery();
      if (rs.next())
      {
        join_activity_batchNo = rs.getInt("int_batchNo");
        join_monitor_counter = rs.getInt("int_join_monitor");
      }

      ConnUtils.cleanupNoThrow(pstmt);
      pstmt = null;

      if ((disp_activity_batchNo + 1) < join_activity_batchNo)
      {
        eventResult.first(false);
        eventResult.last(false);

        return eventResult;
      }

      //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 
      // 3. ȡ�û�۵Ļ�ڵ㵱ǰ��ɵ�ǰ�̹�������Ϣ
      //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
      List inTrans = joinActivity.getIncomingTransitions();
      int inTrans_size = inTrans.size();

      int falseTrans_size = 0;
      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=? ";
      pstmt = conn.prepareStatement(strSQL);

      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);
          event_pstmt.setString(3, processId);
          event_pstmt.setString(4, caseId);
View Full Code Here

    UserTransaction userTransaction,
    WorkflowWork workflowWork,
    WorkflowTransition workflowTransition)
  {
    WorkflowCase workflowCase = workflowWork.getWorkflowCase();
    WorkflowActivity dispActivity = workflowTransition.getFromWorkflowActivity();
    String disp_owner_process_id = dispActivity.getWorkflowProcess().getUUID();
    String disp_activity_id = dispActivity.getUUID();

    String packageId = workflowProcess.getWorkflowPackage().getUUID();
    String processId = workflowProcess.getUUID();
    String caseId = workflowCase.getUUID();

    WorkflowActivity joinActivity = workflowTransition.getToWorkflowActivity();
    String join_owner_process_id = joinActivity.getWorkflowProcess().getUUID();
    String join_activity_id = joinActivity.getUUID();

    Connection conn = (Connection) userTransaction.getStoreConnection().get();
    PreparedStatement pstmt = null;
    ResultSet rs = null;
    String strSQL = null;

    MonitorEventResult eventResult = new MonitorEventResult();

    try
    {
      String join_work_id = null;

      strSQL =
        "SELECT vc_uuid  FROM "
          + caseDatabase.getSchemaContext().getTableName(SchemaContext.SCHEMA_WORK)
          + " "
          + "WHERE  dat_acceptTime IS NULL "
          + "AND    vc_packageid=? "
          + "AND    vc_processid=? "
          + "AND    vc_caseid=?  "
          + "AND    vc_owner_processid=? "
          + "AND    vc_activityid=? ";

      pstmt = conn.prepareStatement(strSQL);
      pstmt.setString(1, packageId);
      pstmt.setString(2, processId);
      pstmt.setString(3, caseId);
      pstmt.setString(4, join_owner_process_id);
      pstmt.setString(5, join_activity_id);

      rs = pstmt.executeQuery();
      if (rs.next())
      {
        eventResult.first(false);
        eventResult.last(false);
        join_work_id = rs.getString("vc_uuid");
      }
      else
      {
        eventResult.first(true);
        eventResult.last(false);
      }
      ConnUtils.cleanupNoThrow(pstmt);
      pstmt = null;

      int join_monitor_counter = 0;
      int join_monitor_total = 0;

      strSQL =
        "SELECT vc_batchNo FROM "
          + caseDatabase.getSchemaContext().getTableName(SchemaContext.SCHEMA_PATH)
          + " "
          + "WHERE  vc_packageid=? "
          + "AND    vc_processid=? "
          + "AND    vc_caseid=?  "
          + "AND    vc_to=? ";
      pstmt = conn.prepareStatement(strSQL);
      pstmt.setString(1, packageId);
      pstmt.setString(2, processId);
      pstmt.setString(3, caseId);
      pstmt.setString(4, workflowWork.getUUID());
      rs = pstmt.executeQuery();

      rs.next();
      String dispBatchNo = rs.getString("vc_batchNo");

      ConnUtils.cleanupNoThrow(pstmt);
      pstmt = null;

      strSQL =
        "SELECT count(*) FROM "
          + caseDatabase.getSchemaContext().getTableName(SchemaContext.SCHEMA_PATH)
          + " "
          + "WHERE  vc_packageid=? "
          + "AND    vc_processid=? "
          + "AND    vc_caseid=?  "
          + "AND    vc_batchNo=? ";
      pstmt = conn.prepareStatement(strSQL);
      pstmt.setString(1, packageId);
      pstmt.setString(2, processId);
      pstmt.setString(3, caseId);
      pstmt.setString(4, dispBatchNo);
      rs = pstmt.executeQuery();

      rs.next();
      join_monitor_total = rs.getInt(1);

      ConnUtils.cleanupNoThrow(pstmt);
      pstmt = null;

      if (eventResult.first())
      {
        join_monitor_counter = 0;
      }
      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)
View Full Code Here

    WorkflowWork workflowWork,
    WorkflowTransition workflowTransition)
  {

    WorkflowCase workflowCase = workflowWork.getWorkflowCase();
    WorkflowActivity dispActivity = workflowTransition.getFromWorkflowActivity();
    String disp_owner_process_id = dispActivity.getWorkflowProcess().getUUID();
    String disp_activity_id = dispActivity.getUUID();

    String packageId = workflowProcess.getWorkflowPackage().getUUID();
    String processId = workflowProcess.getUUID();
    String caseId = workflowCase.getUUID();

    WorkflowActivity joinActivity = workflowTransition.getToWorkflowActivity();
    String join_owner_process_id = joinActivity.getWorkflowProcess().getUUID();
    String join_activity_id = joinActivity.getUUID();

    Connection conn = (Connection) userTransaction.getStoreConnection().get();
    PreparedStatement pstmt = null;
    ResultSet rs = null;
    String strSQL = null;
View Full Code Here

    //System.err.println("-------end---------SetTransitionActivityRule------------");

    // Identify the actual property name and value to be used
    String actualName = this.propName;
    String actualValueId = null;
    WorkflowActivity activity = null;
    actualValueId=(String)values.get(this.xmlName);
 
    // Get a reference to the top object
    Object top = digester.peek();
    // Log some debugging information
View Full Code Here

     }
    
    int size=activities.size();
    for(int i=0;i<size;++i)
    {
      WorkflowActivity  target=(WorkflowActivity)activities.get(i);
      if(target.getUUID().equals(activityId))
      {      
        return target;
      }
    }
    return null;
View Full Code Here

    }
   
    int size=activities.size();
    for(int i=0;i<size;++i)
    {
      WorkflowActivity  target=(WorkflowActivity)activities.get(i);
      if(activityNameOrID.equals(target.getName()))
      {      
        return target;
      }
    }
    return null;
View Full Code Here

  public WorkflowTransition findWorkflowTransition(
    WorkflowActivity fromActivity,
    WorkflowActivity toActivity)
  {
    WorkflowTransition target=null;
    WorkflowActivity from=null;
    WorkflowActivity to=null;
   
    for(int i=0;i<transitions.size();++i)
    {
      target=(WorkflowTransition)transitions.get(i);
      from=target.getFromWorkflowActivity();
      to=target.getToWorkflowActivity();
     
      if(from.equals(fromActivity) && to.equals(toActivity))
      {
        return target;
      }
    }
    return null;
View Full Code Here

TOP

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

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.