Package org.uengine.processmanager

Examples of org.uengine.processmanager.ProcessManagerRemote


    MakeProcessDefinitionToJSON mkProcessDefinitionToJSON = null;
    MakeProcessInstanceToJSON mkProcessInstanceToJSON = null;
    String result = null;
   
    ProcessManagerFactoryBean processManagerFactory = new ProcessManagerFactoryBean();
    ProcessManagerRemote pm = null;
   
    try {
      pm = processManagerFactory.getProcessManagerForReadOnly();
     
      if (instanceId != null) {
        mkProcessInstanceToJSON = new MakeProcessInstanceToJSON(pm.getProcessInstance(instanceId));
        mkProcessInstanceToJSON.setOnlyHumanActivity(onlyHumanActivity);
        mkProcessInstanceToJSON.setPm(pm);
        result = mkProcessInstanceToJSON.toJSON(pm.getProcessDefinitionWithInstanceId(instanceId));
      } else {
        mkProcessDefinitionToJSON = new MakeProcessDefinitionToJSON();
        mkProcessDefinitionToJSON.setOnlyHumanActivity(onlyHumanActivity);
        if (defVerId != null) {
          result = mkProcessDefinitionToJSON.toJSON(pm.getProcessDefinition(defVerId));
        } else if (defId != null) {
          String tempDefVerId = pm.getProcessDefinitionProductionVersion(defId);
          result = mkProcessDefinitionToJSON.toJSON(pm.getProcessDefinition(tempDefVerId));
        }
      }
    } catch (Exception e) {
      e.printStackTrace();
    } finally {
      try {
        pm.remove();
      } catch (Exception e) {
      }
    }
   
    arg1.setContentType("application/json; charset=UTF-8");
View Full Code Here


    String returnEndpoint = null;
    String returnInstanceId = null;
    List<TaskInfo> taskInfoList = null;
   
    ProcessManagerFactoryBean pmfb = new ProcessManagerFactoryBean();
    ProcessManagerRemote pm = null;
    try {
      pm = pmfb.getProcessManager();
     
      ProcessManagerService pms = new ProcessManagerService(pm, request);
     
      if (StdMsgContext.CMD_PROCESS_START.equalsIgnoreCase(cmdBpm)) {
        ProcessStartMsg psMsg = stdMsgContext.bindProcessStartMsg(request);
        System.out.println(psMsg);
       
        String newInstanceId = pms.processStart(psMsg);
       
        returnEndpoint = psMsg.getInitiator();
        returnInstanceId = newInstanceId;

      } else if (StdMsgContext.CMD_ACTIVITY_COMPLETE.equalsIgnoreCase(cmdBpm)) {
        ActivityCompleteMsg acMsg = stdMsgContext.bindActivityCompleteMsg(request);
        System.out.println(acMsg);
       
        pms.activityComplete(acMsg);
       
        returnEndpoint = acMsg.getEndpoint();
        returnInstanceId = acMsg.getInstanceId();
       
      } else if (StdMsgContext.CMD_PROCESS_STOP.equalsIgnoreCase(cmdBpm)) {
        ProcessStopMsg psMsg = stdMsgContext.bindProcessStopMsg(request);
        System.out.println(psMsg);
       
        pms.processStop(psMsg);
       
      } else if (StdMsgContext.CMD_APPROVAL_DRAFT.equalsIgnoreCase(cmdBpm)) {
        ApprovalDraftActivityCompleteMsg adacMsg = stdMsgContext.bindApprovalDraftMsg(request);
       
        System.out.println(adacMsg);
        pms.approvalDraftActivityComplete(adacMsg);
       
        returnEndpoint = adacMsg.getEndpoint();
        returnInstanceId = adacMsg.getInstanceId();
       
      } else if (StdMsgContext.CMD_APPROVAL_COMPLETE.equalsIgnoreCase(cmdBpm)) {
        ApprovalActivityCompleteMsg aacMsg = stdMsgContext.bindApprovalActivityCompleteMsg(request);
        System.out.println(aacMsg);
       
        pms.approvalActivityComplete(aacMsg);
       
        returnEndpoint = aacMsg.getEndpoint();
        returnInstanceId = aacMsg.getInstanceId();

      } else if (StdMsgContext.CMD_APPROVAL_LINE_CHANGE.equalsIgnoreCase(cmdBpm))  {
        ApprovalLineChangeMsg alcMsg = stdMsgContext.bindApprovalLineChangeMsg(request);
        System.out.println(alcMsg);
       
        pms.approvalLineChange(alcMsg);
     
      } else if (StdMsgContext.CMD_TASK_INFO.equalsIgnoreCase(cmdBpm)) {
        TaskInfoMsg tiMsg = stdMsgContext.bindTaskInfoMsg(request);
//        System.out.println(tiMsg);
       
        taskInfoList = pms.getTaskInfo(tiMsg);
       
      } else if (StdMsgContext.CMD_INITIALIZE_PROCESS_INSTANCE.equalsIgnoreCase(cmdBpm)) {
        InitializeProcessInstanceMsg ipiMsg = stdMsgContext.bindInitializeProcessInstanceMsg(request);
        System.out.println(ipiMsg);
       
        pms.initializeProcessInstance(ipiMsg);
       
      } else if (StdMsgContext.CMD_WORKITEM_ACCEPT.equalsIgnoreCase(cmdBpm)) {
        WorkItemAcceptMsg wiaMsg = stdMsgContext.bindWorkItemAcceptMsg(request);
        System.out.println(wiaMsg);
       
        pms.workItemAccept(wiaMsg);
       
      } else if (StdMsgContext.CMD_DELEGATE_WORKITEM.equalsIgnoreCase(cmdBpm)) {
        DelegateWorkItemMsg dwMsg = stdMsgContext.bindDelegateWorkItemMsg(request);
        System.out.println(dwMsg);
       
        pms.delegateWorkItem(dwMsg);
       
      }
     
      pm.applyChanges();
     
     
      if (!StdMsgContext.CMD_TASK_INFO.equalsIgnoreCase(cmdBpm) && StringUtils.hasText(returnInstanceId) && StringUtils.hasText(returnEndpoint)) {
        taskInfoList = pms.getTaskInfo(returnInstanceId, returnEndpoint);
      }
     
      String returnXmlMsg = makeReturnMsg("S", taskInfoList);
      System.out.println(returnXmlMsg);
     
      response.getWriter().print(returnXmlMsg);
     
    } catch (Exception e) {
      e.printStackTrace();
     
      if (pm != null)
        pm.cancelChanges();
     
      response.getWriter().print(makeReturnMsg("F", null));
     
    } finally {
      if (pm != null)
        try {
          pm.remove();
        } catch (RemoveException e) {
        }
       
      response.getWriter().flush();
      response.getWriter().close();
View Full Code Here

   
    String status = null;
    List<TaskInfo> taskInfoList = null;
   
    ProcessManagerFactoryBean pmfb = new ProcessManagerFactoryBean();
    ProcessManagerRemote pm = null;
    try {
      pm = pmfb.getProcessManager();
     
      ProcessManagerService pms = new ProcessManagerService(pm, null);
      pms.workItemAccept(wiaMsg);
      pm.applyChanges();
     
      status = "S";
     
    } catch (Exception e) {
      e.printStackTrace();
     
      if (pm != null)
        try {
          pm.cancelChanges();
        } catch (Exception e1) {
        }
     
      status = "F";
     
    } finally {
      if (pm != null)
        try {
          pm.remove();
        } catch (RemoveException e) {
        }
    }

    return MakeReturnMsg.toElement(status, taskInfoList, WORKITEM_ACCEPT_RESPONSE, WORKFLOW_NAMESPACE);
View Full Code Here

   
    String status = null;
    List<TaskInfo> taskInfoList = null;
   
    ProcessManagerFactoryBean pmfb = new ProcessManagerFactoryBean();
    ProcessManagerRemote pm = null;
    try {
      pm = pmfb.getProcessManager();
     
      ProcessManagerService pms = new ProcessManagerService(pm, null);
      pms.initializeProcessInstance(ipiMsg);
      pm.applyChanges();
     
      status = "S";
     
    } catch (Exception e) {
      e.printStackTrace();
     
      if (pm != null)
        try {
          pm.cancelChanges();
        } catch (Exception e1) {
        }
     
      status = "F";
     
    } finally {
      if (pm != null)
        try {
          pm.remove();
        } catch (RemoveException e) {
        }
    }

    return MakeReturnMsg.toElement(status, taskInfoList, INITIALIZE_PROCESS_INSTANCE_RESPONSE, WORKFLOW_NAMESPACE);
View Full Code Here

   
    String status = null;
    List<TaskInfo> taskInfoList = null;
   
    ProcessManagerFactoryBean pmfb = new ProcessManagerFactoryBean();
    ProcessManagerRemote pm = null;
    try {
      pm = pmfb.getProcessManager();
     
      ProcessManagerService pms = new ProcessManagerService(pm, null);
      String newInstanceId = pms.processStart(psMsg);
      pm.applyChanges();
     
      if (StringUtils.hasText(newInstanceId) && StringUtils.hasText(psMsg.getInitiator())) {
        taskInfoList = pms.getTaskInfo(newInstanceId, psMsg.getInitiator());
      }
     
      status = "S";
     
    } catch (Exception e) {
      e.printStackTrace();
     
      if (pm != null)
        try {
          pm.cancelChanges();
        } catch (Exception e1) {
        }
     
      status = "F";
     
    } finally {
      if (pm != null)
        try {
          pm.remove();
        } catch (RemoveException e) {
        }
    }

    return MakeReturnMsg.toElement(status, taskInfoList, PROCESS_START_RESPONSE, WORKFLOW_NAMESPACE);
View Full Code Here

   
    String status = null;
    List<TaskInfo> taskInfoList = null;
   
    ProcessManagerFactoryBean pmfb = new ProcessManagerFactoryBean();
    ProcessManagerRemote pm = null;
    try {
      pm = pmfb.getProcessManagerForReadOnly();
     
      ProcessManagerService pms = new ProcessManagerService(pm, null);
      taskInfoList = pms.getTaskInfo(taskInfoMsg);
      pm.applyChanges();
     
      status = "S";
     
    } catch (Exception e) {
      e.printStackTrace();
     
      if (pm != null)
        try {
          pm.cancelChanges();
        } catch (Exception e1) {
        }
     
      status = "F";
     
    } finally {
      if (pm != null)
        try {
          pm.remove();
        } catch (RemoveException e) {
        }
    }

    return MakeReturnMsg.toElement(status, taskInfoList, TASK_INFO_RESPONSE, WORKFLOW_NAMESPACE);
View Full Code Here

   
    String status = null;
    List<TaskInfo> taskInfoList = null;
   
    ProcessManagerFactoryBean pmfb = new ProcessManagerFactoryBean();
    ProcessManagerRemote pm = null;
    try {
      pm = pmfb.getProcessManager();
     
      ProcessManagerService pms = new ProcessManagerService(pm, null);
      pms.approvalActivityComplete(aacMsg);
      pm.applyChanges();
     
      if (StringUtils.hasText(aacMsg.getInstanceId()) && StringUtils.hasText(aacMsg.getEndpoint())) {
        taskInfoList = pms.getTaskInfo(aacMsg.getInstanceId(), aacMsg.getEndpoint());
      }
     
      status = "S";
     
    } catch (Exception e) {
      e.printStackTrace();
     
      if (pm != null)
        try {
          pm.cancelChanges();
        } catch (Exception e1) {
        }
     
      status = "F";
     
    } finally {
      if (pm != null)
        try {
          pm.remove();
        } catch (RemoveException e) {
        }
    }

    return MakeReturnMsg.toElement(status, taskInfoList, APPROVAL_ACTIVITY_COMPLETE_RESPONSE, WORKFLOW_NAMESPACE);
View Full Code Here

TOP

Related Classes of org.uengine.processmanager.ProcessManagerRemote

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.