Package org.huihoo.workflow.impl.monitor

Examples of org.huihoo.workflow.impl.monitor.MonitorEventResult


    EventMonitorThread eventMonitorThread = context.getEventMonitorThread(workflowProcess.getWorkflowPackage());
    MonitorEvent monitorEvent =
      new MonitorEvent(workflowService, workflowProcess, operator, userTransaction, workflowWork, workflowTransition);
    eventMonitorThread.sendEvent(monitorEvent);

    MonitorEventResult eventResult = monitorEvent.getResult();

    if (eventResult.getException() != null)
    {
      throw new WorkflowException(eventResult.getException());
    }

    Connection conn = (Connection) userTransaction.getStoreConnection().get();
    PreparedStatement pstmt = null;
    String strSQL = null;
    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();
   
    log.debug("\nandJoin monitorEvent == > "+monitorEvent);
   
    try
    {
      if (eventResult.getBatchNo() == 0)
      {
        strSQL =
          "INSERT INTO  "
            + caseDatabase.getSchemaContext().getTableName(SchemaContext.SCHEMA_ACTIVITY_DISPATCH)
            + "(vc_packageid,vc_processid,vc_caseid,vc_owner_processid,vc_activityid,int_batchNo) "
            + " VALUES(?,?,?,?,?,?)";
        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);
        pstmt.setInt(6, eventResult.getBatchNo() + 1);
        pstmt.execute();

        ConnUtils.cleanupNoThrow(pstmt);
        pstmt = null;
      }
      else
      {
        strSQL =
          "UPDATE "
            + caseDatabase.getSchemaContext().getTableName(SchemaContext.SCHEMA_ACTIVITY_DISPATCH)
            + " "
            + "SET    int_batchNo=?,vc_disp_flag=?   "
            + "WHERE  vc_packageid=? "
            + "AND    vc_processid=? "
            + "AND    vc_caseid=?  "
            + "AND    vc_owner_processid=? "
            + "AND    vc_activityid=? ";
        pstmt = conn.prepareStatement(strSQL);
        pstmt.setInt(1, eventResult.getBatchNo() + 1);
        pstmt.setString(2, "TRUE");
        pstmt.setString(3, packageId);
        pstmt.setString(4, processId);
        pstmt.setString(5, caseId);
        pstmt.setString(6, disp_owner_process_id);
        pstmt.setString(7, disp_activity_id);
        ConnUtils.cleanupNoThrow(pstmt);
        pstmt = null;
      }
    }
    catch (SQLException ex)
    {
      throw new WorkflowException(ex);
    }
    finally
    {
      ConnUtils.cleanupNoThrow(pstmt);
      pstmt = null;
    }

    String andJoinWorkId = eventResult.getJoinWorkID();
    if (andJoinWorkId == null)
    {
      //�������ز�һ��,throw InternalError()???
    }
    else
    {
      WorkflowWork andJoinWork =
        caseDatabase.findWorkflowWork(
          workflowProcess,
          operator,
          userTransaction,
          workflowWork.getWorkflowCase(),
          andJoinWorkId);
      caseDatabase.createWorkflowPath(
        workflowProcess,
        operator,
        userTransaction,
        workflowWork.getWorkflowCase(),
        workflowWork,
        andJoinWork,
        pathDispBatch,
        WorkflowActivityEvent.WORK_DISPATCH);

      if (eventResult.last())
      {
        return DispatchController.execute_dispatchIfNecessary(
          workflowService,
          workflowProcess,
          operator,
View Full Code Here


    EventMonitorThread eventMonitorThread = context.getEventMonitorThread(workflowProcess.getWorkflowPackage());
    MonitorEvent monitorEvent =
      new MonitorEvent(workflowService, workflowProcess, operator, userTransaction, workflowWork, workflowTransition);
    eventMonitorThread.sendEvent(monitorEvent);

    MonitorEventResult eventResult = monitorEvent.getResult();

    if (eventResult.getException() != null)
    {
      eventResult.getException().printStackTrace();
      throw new WorkflowException(eventResult.getException());
    }

    Connection conn = (Connection) userTransaction.getStoreConnection().get();
    PreparedStatement pstmt = null;
    String strSQL = null;
    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();
   
    log.debug("\nxorJoin monitorEvent == > "+monitorEvent);
   
    try
    {
      if (eventResult.getBatchNo() == 0)
      {
        strSQL =
          "INSERT INTO  "
            + caseDatabase.getSchemaContext().getTableName(SchemaContext.SCHEMA_ACTIVITY_DISPATCH)
            + "(vc_packageid,vc_processid,vc_caseid,vc_owner_processid,vc_activityid,int_batchNo) "
            + " VALUES(?,?,?,?,?,?)";
        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);
        pstmt.setInt(6, eventResult.getBatchNo() + 1);
        pstmt.execute();

        ConnUtils.cleanupNoThrow(pstmt);
        pstmt = null;
      }
      else
      {
        strSQL =
          "UPDATE "
            + caseDatabase.getSchemaContext().getTableName(SchemaContext.SCHEMA_ACTIVITY_DISPATCH)
            + " "
            + "SET    int_batchNo=?,vc_disp_flag=?   "
            + "WHERE  vc_packageid=? "
            + "AND    vc_processid=? "
            + "AND    vc_caseid=?  "
            + "AND    vc_owner_processid=? "
            + "AND    vc_activityid=? ";
        pstmt = conn.prepareStatement(strSQL);
        pstmt.setInt(1, eventResult.getBatchNo() + 1);
        pstmt.setString(2, "TRUE");
        pstmt.setString(3, packageId);
        pstmt.setString(4, processId);
        pstmt.setString(5, caseId);
        pstmt.setString(6, disp_owner_process_id);
        pstmt.setString(7, disp_activity_id);
        ConnUtils.cleanupNoThrow(pstmt);
        pstmt = null;
      }
    }
    catch (SQLException ex)
    {
      throw new WorkflowException(ex);
    }
    finally
    {
      ConnUtils.cleanupNoThrow(pstmt);
      pstmt = null;

    }
    if (eventResult.first())
    {
      String xorJoinWorkId = eventResult.getJoinWorkID();
      WorkflowWork xorJoinWork =
        caseDatabase.findWorkflowWork(
          workflowProcess,
          operator,
          userTransaction,
View Full Code Here

    EventMonitorThread eventMonitorThread = context.getEventMonitorThread(workflowProcess.getWorkflowPackage());
    MonitorEvent monitorEvent =
      new MonitorEvent(workflowService, workflowProcess, operator, userTransaction, workflowWork, workflowTransition);
    eventMonitorThread.sendEvent(monitorEvent);

    MonitorEventResult eventResult = monitorEvent.getResult();

    if (eventResult.getException() != null)
    {
      eventResult.getException().printStackTrace();
      throw new WorkflowException(eventResult.getException());
    }

    Connection conn = (Connection) userTransaction.getStoreConnection().get();
    PreparedStatement pstmt = null;
    String strSQL = null;
    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();

    log.debug("\norJoin monitorEvent == > "+monitorEvent);
   
    try
    {
      if (eventResult.getBatchNo() == 0)
      {
        strSQL =
          "INSERT INTO  "
            + caseDatabase.getSchemaContext().getTableName(SchemaContext.SCHEMA_ACTIVITY_DISPATCH)
            + "(vc_packageid,vc_processid,vc_caseid,vc_owner_processid,vc_activityid,int_batchNo) "
            + " VALUES(?,?,?,?,?,?)";
        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);
        pstmt.setInt(6, eventResult.getBatchNo() + 1);
        pstmt.execute();

        ConnUtils.cleanupNoThrow(pstmt);
        pstmt = null;
      }
      else
      {
        strSQL =
          "UPDATE "
            + caseDatabase.getSchemaContext().getTableName(SchemaContext.SCHEMA_ACTIVITY_DISPATCH)
            + " "
            + "SET    int_batchNo=?,vc_disp_flag=?   "
            + "WHERE  vc_packageid=? "
            + "AND    vc_processid=? "
            + "AND    vc_caseid=?  "
            + "AND    vc_owner_processid=? "
            + "AND    vc_activityid=? ";
        pstmt = conn.prepareStatement(strSQL);
        pstmt.setInt(1, eventResult.getBatchNo() + 1);
        pstmt.setString(2, "TRUE");
        pstmt.setString(3, packageId);
        pstmt.setString(4, processId);
        pstmt.setString(5, caseId);
        pstmt.setString(6, disp_owner_process_id);
        pstmt.setString(7, disp_activity_id);
        ConnUtils.cleanupNoThrow(pstmt);
        pstmt = null;
      }
    }
    catch (SQLException ex)
    {
      throw new WorkflowException(ex);
    }
    finally
    {
      ConnUtils.cleanupNoThrow(pstmt);
      pstmt = null;

    }
    String orJoinWorkId = eventResult.getJoinWorkID();
    if (orJoinWorkId == null)
    {
      //�������ز�һ��,throw InternalError()???
    }
    else
    {
      WorkflowWork orJoinWork =
        caseDatabase.findWorkflowWork(
          workflowProcess,
          operator,
          userTransaction,
          workflowWork.getWorkflowCase(),
          orJoinWorkId);
      caseDatabase.createWorkflowPath(
        workflowProcess,
        operator,
        userTransaction,
        workflowWork.getWorkflowCase(),
        workflowWork,
        orJoinWork,
        pathDispBatch,
        WorkflowActivityEvent.WORK_DISPATCH);

      if (eventResult.last())
      {
        return DispatchController.execute_dispatchIfNecessary(
          workflowService,
          workflowProcess,
          operator,
View Full Code Here

    EventMonitorThread eventMonitorThread = context.getEventMonitorThread(workflowProcess.getWorkflowPackage());
    MonitorEvent monitorEvent =
      new MonitorEvent(workflowService, workflowProcess, operator, userTransaction, workflowWork, workflowTransition);
    eventMonitorThread.sendEvent(monitorEvent);

    MonitorEventResult eventResult = monitorEvent.getResult();

    if (eventResult.getException() != null)
    {
      throw new WorkflowException(eventResult.getException());
    }

    Connection conn = (Connection) userTransaction.getStoreConnection().get();
    PreparedStatement pstmt = null;
    String strSQL = null;
    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();
   
    log.debug("\ninstanceAndJoin monitorEvent == > "+monitorEvent);
   
    try
    {
      if (eventResult.getBatchNo() == 0)
      {
        strSQL =
          "INSERT INTO  "
            + caseDatabase.getSchemaContext().getTableName(SchemaContext.SCHEMA_ACTIVITY_DISPATCH)
            + "(vc_packageid,vc_processid,vc_caseid,vc_owner_processid,vc_activityid,int_batchNo) "
            + " VALUES(?,?,?,?,?,?)";
        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);
        pstmt.setInt(6, eventResult.getBatchNo() + 1);
        pstmt.execute();

        ConnUtils.cleanupNoThrow(pstmt);
        pstmt = null;
      }
      else
      {
        strSQL =
          "UPDATE "
            + caseDatabase.getSchemaContext().getTableName(SchemaContext.SCHEMA_ACTIVITY_DISPATCH)
            + " "
            + "SET    int_batchNo=?,vc_disp_flag=?   "
            + "WHERE  vc_packageid=? "
            + "AND    vc_processid=? "
            + "AND    vc_caseid=?  "
            + "AND    vc_owner_processid=? "
            + "AND    vc_activityid=? ";
        pstmt = conn.prepareStatement(strSQL);
        pstmt.setInt(1, eventResult.getBatchNo() + 1);
        pstmt.setString(2, "TRUE");
        pstmt.setString(3, packageId);
        pstmt.setString(4, processId);
        pstmt.setString(5, caseId);
        pstmt.setString(6, disp_owner_process_id);
        pstmt.setString(7, disp_activity_id);
        ConnUtils.cleanupNoThrow(pstmt);
        pstmt = null;
      }
    }
    catch (SQLException ex)
    {
      throw new WorkflowException(ex);
    }
    finally
    {
      ConnUtils.cleanupNoThrow(pstmt);
      pstmt = null;
    }

    String andJoinWorkId = eventResult.getJoinWorkID();
    if (andJoinWorkId == null)
    {
      //�������ز�һ��,throw InternalError()???
    }
    else
    {
      WorkflowWork andJoinWork =
        caseDatabase.findWorkflowWork(
          workflowProcess,
          operator,
          userTransaction,
          workflowWork.getWorkflowCase(),
          andJoinWorkId);
      caseDatabase.createWorkflowPath(
        workflowProcess,
        operator,
        userTransaction,
        workflowWork.getWorkflowCase(),
        workflowWork,
        andJoinWork,
        pathDispBatch,
        WorkflowActivityEvent.WORK_DISPATCH);

      if (eventResult.last())
      {
        return DispatchController.execute_dispatchIfNecessary(
          workflowService,
          workflowProcess,
          operator,
View Full Code Here

    EventMonitorThread eventMonitorThread = context.getEventMonitorThread(workflowProcess.getWorkflowPackage());
    MonitorEvent monitorEvent =
      new MonitorEvent(workflowService, workflowProcess, operator, userTransaction, workflowWork, workflowTransition);
    eventMonitorThread.sendEvent(monitorEvent);

    MonitorEventResult eventResult = monitorEvent.getResult();

    if (eventResult.getException() != null)
    {
      throw new WorkflowException(eventResult.getException());
    }

    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();
   
    log.debug("\ninstanceXorJoin monitorEvent == > "+monitorEvent);
   
    if (eventResult.first())
    {
      String xor_work_id = eventResult.getJoinWorkID();
      WorkflowWork xorJoinWork =
        caseDatabase.findWorkflowWork(
          workflowProcess,
          operator,
          userTransaction,
View Full Code Here

TOP

Related Classes of org.huihoo.workflow.impl.monitor.MonitorEventResult

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.