Package org.uengine.processmanager

Examples of org.uengine.processmanager.ProcessManagerRemote


    String instanceId = instanceIdExpression.valueOf(workItemAcceptRequest);
    String tracingTag = tracingTagExpression.valueOf(workItemAcceptRequest);
    String endpoint = endpointExpression.valueOf(workItemAcceptRequest);

    ProcessManagerFactoryBean processManagerFactory = new ProcessManagerFactoryBean();
    ProcessManagerRemote pm = null;

    InitialContext context = new InitialContext();
    UserTransaction tx = (GlobalContext.useManagedTransaction ? (UserTransaction) context.lookup(GlobalContext.USERTRANSACTION_JNDI_NAME) : null);

    String responseEndPoint = null;

    try {
      pm = processManagerFactory.getProcessManager();

      if (tx != null)
        tx.begin();

      responseEndPoint = workflowService.workItemAccept(instanceId, tracingTag, endpoint, pm);
      pm.applyChanges();

      if (tx != null && tx.getStatus() != Status.STATUS_NO_TRANSACTION)
        tx.commit();

    } catch (Exception e) {
      try {
        pm.cancelChanges();
      } catch (Exception ex) {
      }

      if (tx != null && tx.getStatus() != Status.STATUS_NO_TRANSACTION)
        tx.rollback();

    } finally {
      try {
        pm.remove();
      } catch (Exception e) {
      }
    }

    Element response = new Element(WORKITEM_ACCEPT_RESPONSE, WORKFLOW_NAMESPACE).setText(responseEndPoint);
View Full Code Here


    List elementProcessVariableList = completeWorkitemRequest.getChildren("processVariable", WORKFLOW_NAMESPACE);
    HashMap processVariableMap = ElementToObject.makeProcessVariableMap(elementProcessVariableList);

    ProcessManagerFactoryBean processManagerFactory = new ProcessManagerFactoryBean();
    ProcessManagerRemote pm = null;

    InitialContext context = new InitialContext();
    UserTransaction tx = (GlobalContext.useManagedTransaction ? (UserTransaction) context.lookup(GlobalContext.USERTRANSACTION_JNDI_NAME) : null);

    String completedTaskId = null;
    List nextTaskList = null;

    try {
      pm = processManagerFactory.getProcessManager();

      if (tx != null)
        tx.begin();

      completedTaskId = workflowService.completeWorkitem(endpoint, instanceId, taskId, tracingTag, processVariableMap, pm);
      pm.applyChanges();

      nextTaskList = workflowService.nextTask(instanceId);

      if (tx != null && tx.getStatus() != Status.STATUS_NO_TRANSACTION)
        tx.commit();

    } catch (Exception e) {
      try {
        pm.cancelChanges();
      } catch (Exception ex) {
      }

      if (tx != null && tx.getStatus() != Status.STATUS_NO_TRANSACTION)
        tx.rollback();

    } finally {
      try {
        pm.remove();
      } catch (Exception e) {
      }
    }

    Document doc = new Document(new Element(COMPLETE_WORKITEM_RESPONSE, WORKFLOW_NAMESPACE));
View Full Code Here

    List elementProcessVariableList = setProcessVariableRequest.getChildren("processVariable", WORKFLOW_NAMESPACE);
    HashMap processVariableMap = ElementToObject.makeProcessVariableMap(elementProcessVariableList);

    ProcessManagerFactoryBean processManagerFactory = new ProcessManagerFactoryBean();
    ProcessManagerRemote pm = null;

    InitialContext context = new InitialContext();
    UserTransaction tx = (GlobalContext.useManagedTransaction ? (UserTransaction) context.lookup(GlobalContext.USERTRANSACTION_JNDI_NAME) : null);

    try {
      pm = processManagerFactory.getProcessManager();

      if (tx != null)
        tx.begin();

      instanceId = workflowService.setProcessVariable(instanceId, processVariableMap, pm);

      pm.applyChanges();

      if (tx != null && tx.getStatus() != Status.STATUS_NO_TRANSACTION)
        tx.commit();

    } catch (Exception e) {
      try {
        pm.cancelChanges();
      } catch (Exception ex) {
      }

      if (tx != null && tx.getStatus() != Status.STATUS_NO_TRANSACTION)
        tx.rollback();

    } finally {
      try {
        pm.remove();
      } catch (Exception e) {
      }
    }

    Element response = new Element(SET_PROCESS_VARIABLE_RESPONSE, WORKFLOW_NAMESPACE).setText(instanceId);
View Full Code Here

    List elementProcessVariableList = startProcessRequest.getChildren("processVariable", WORKFLOW_NAMESPACE);
    HashMap processVariableMap = ElementToObject.makeProcessVariableMap(elementProcessVariableList);

    ProcessManagerFactoryBean processManagerFactory = new ProcessManagerFactoryBean();
    ProcessManagerRemote pm = null;

    InitialContext context = new InitialContext();
    UserTransaction tx = (GlobalContext.useManagedTransaction ? (UserTransaction) context.lookup(GlobalContext.USERTRANSACTION_JNDI_NAME) : null);

    String instanceId = null;
    List nextTaskList = null;

    try {
      pm = processManagerFactory.getProcessManager();

      if (tx != null)
        tx.begin();

      instanceId = workflowService.startProcess(type, alias, initiator, processVariableMap, pm);
      pm.applyChanges();

      nextTaskList = workflowService.nextTask(instanceId);

      if (tx != null && tx.getStatus() != Status.STATUS_NO_TRANSACTION)
        tx.commit();

    } catch (Exception e) {
      try {
        pm.cancelChanges();
      } catch (Exception ex) {
      }

      if (tx != null && tx.getStatus() != Status.STATUS_NO_TRANSACTION)
        tx.rollback();

    } finally {
      try {
        pm.remove();
      } catch (Exception e) {
      }
    }

    Document doc = new Document(new Element(START_PROCESS_RESPONSE, WORKFLOW_NAMESPACE));
View Full Code Here

    int pageCount = Integer.parseInt(UEngineUtil.isNotEmpty(_pageCount) ? _pageCount : "10");
    String _currentPage = currentPageExpression.valueOf(getWorkListRequest);
    int currentPage = Integer.parseInt(UEngineUtil.isNotEmpty(_currentPage) ? _currentPage : "1");

    ProcessManagerFactoryBean processManagerFactory = new ProcessManagerFactoryBean();
    ProcessManagerRemote pm = null;

//    InitialContext context = new InitialContext();
//    UserTransaction tx = (GlobalContext.useManagedTransaction ? (UserTransaction) context.lookup(GlobalContext.USERTRANSACTION_JNDI_NAME) : null);

    List workList = null;

    try {
      pm = processManagerFactory.getProcessManagerForReadOnly();

      workList = workflowService.getWorkList(endpoint, filter, pageCount, currentPage, pm);
    } catch (Exception e) {
      e.printStackTrace();
    } finally {
      try {
        pm.remove();
      } catch (Exception e) {
      }
    }

    Document doc = new Document(new Element(GET_WORKLIST_RESPONE, WORKFLOW_NAMESPACE));
View Full Code Here

 
  ProcessManagerFactoryBean processManagerFactory = new ProcessManagerFactoryBean();
 
    public java.lang.String initializeProcess(java.lang.String in0, java.lang.String in1) throws java.rmi.RemoteException {
        try {
          ProcessManagerRemote pm = processManagerFactory.getProcessManager();
      String instanceId = pm.initializeProcess(in0, in1);
      pm.applyChanges();

      return instanceId;
    } catch (Exception e) {
      throw new RemoteException("WebServiceRemote:", e);
    }
View Full Code Here

    }
    }

    public void executeProcess(java.lang.String in0) throws java.rmi.RemoteException {
        try {
          ProcessManagerRemote pm = processManagerFactory.getProcessManager();
      pm.executeProcess(in0);
      pm.applyChanges();
    } catch (Exception e) {
      throw new RemoteException("WebServiceRemote:", e);
    }
    }
View Full Code Here

    }
    }

    public void executeProcessByWorkitem(java.lang.String in0, org.uengine.kernel.ResultPayload in1) throws java.rmi.RemoteException {
        try {
          ProcessManagerRemote pm = processManagerFactory.getProcessManager();
      pm.executeProcessByWorkitem(in0, in1);
      pm.applyChanges();
    } catch (Exception e) {
      throw new RemoteException("WebServiceRemote:", e);
    }
    }
View Full Code Here

    }
    }

    public String intializeAndExecuteProcessByWorkitem(java.lang.String in0, org.uengine.kernel.ResultPayload in1) throws java.rmi.RemoteException {
        try {
          ProcessManagerRemote pm = processManagerFactory.getProcessManager();
          String instanceId = pm.initializeProcess(in0);
      pm.executeProcessByWorkitem(instanceId, in1);
      pm.applyChanges();
     
      return instanceId;
    } catch (Exception e) {
      throw new RemoteException("WebServiceRemote:", e);
    }
View Full Code Here

    }
    }

    public void setProcessVariable(java.lang.String in0, java.lang.String in1, java.lang.String in2, java.lang.Object in3) throws java.rmi.RemoteException {
        try {
          ProcessManagerRemote pm = processManagerFactory.getProcessManager();
      pm.setProcessVariable(in0, in1, in2, (Serializable)in3);
      pm.applyChanges();
    } catch (Exception e) {
      throw new RemoteException("WebServiceRemote:", e);
    }
    }
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.