Package org.uengine.kernel

Examples of org.uengine.kernel.ProcessInstance


    logInst("viewProcessInstanceFlowChart", new Object[]{instanceId, options});
    try{
      if(instanceId == null) return "";
        //throw new RemoteException("ProcessManagerError: null process instance id");
     
      ProcessInstance instance = getInstance(instanceId);
      ProcessDefinition definition = instance.getProcessDefinition();
     
      //for performance and synchronized view - we don't need to create snapshot by the implementation of caching logic.
      ProcessInstance shotCopy = instance;//instance.createSnapshot();
      instance.setProcessDefinition(definition);
      //
      ActivityViewer processDefinitionViewer = DefaultActivityViewer.createViewer(definition);
      return processDefinitionViewer.render(definition, shotCopy, options).toString();
     
View Full Code Here


  }
 
  public Hashtable getActivityInstanceDetails(String instanceId, String tracingTag) throws RemoteException{
    logInst("getActivityInstanceDetails", new Object[]{instanceId, tracingTag});
    try{
      ProcessInstance instance = getInstance(instanceId);
      //ProcessDefinition definition = instance.getProcessDefinition();
   
      return (Hashtable)instance.getActivityDetails(tracingTag);
    }catch(Exception e){
      e.printStackTrace();
      throw new RemoteException("ProcessManagerError:"+e.getMessage(), e);
    }
  }
View Full Code Here

    logInst("getActivityStatus", new Object[]{instanceId, tracingTag});
    try{
      if(instanceId==null)
        return null;
     
      ProcessInstance instance = getInstance(instanceId);
   
      return instance.getStatus(tracingTag);
    }catch(Exception e){
      e.printStackTrace();
      throw new RemoteException("ProcessManagerError:"+e.getMessage(), e);
    }
  }
View Full Code Here

  }
 
  public Serializable sendMessage(String instanceId, String message, Serializable payload) throws RemoteException{
    logInst("sendMessage", new Object[]{instanceId, message, payload});
    try{
      ProcessInstance instance = getInstance(instanceId);
      ProcessDefinition definition = instance.getProcessDefinition();
      return (Serializable)definition.fireMessage(message, instance, payload); //send message to the whole subscribers regardless of given instance id. it means even if there're instance which didn't subscribe, the instance will be ignored.

//      MessageProcessorBean.queueMessage(message, instanceId, payload);
     
      //review:
View Full Code Here

 
  //TODO not supported now
  public Serializable sendMessageXML(String instanceId, String message, String payload) throws RemoteException{
    logInst("sendMessageXML", new Object[]{instanceId, message, payload});
    try{
      ProcessInstance instance = getInstance(instanceId);
      ProcessDefinition definition = instance.getProcessDefinition();
     
      return (Serializable)definition.fireMessageXML(message, instance, payload); //send message to the whole subscribers regardless of given instance id. it means even if there're instance which didn't subscribe, the instance will be ignored.
   
    }catch(Exception e){
      e.printStackTrace();
View Full Code Here

       
        executeProcess(instanceId);
      }
*/
     
      ProcessInstance instance = getInstance(instanceId);
     
      if(!instance.isRunning("")
          && !((HumanActivity)instance.getProcessDefinition().getActivity(tracingTag)).isNotificationWorkitem()
        )
        instance.execute();
     
      ProcessDefinition definition = instance.getProcessDefinition();
          
      boolean isInitiationInSubprocess = false;
      String absoluteTracingTag = tracingTag;
     
      if(tracingTag.indexOf("@")>0){
        isInitiationInSubprocess = true;
        String[] scopesByTracingTag = tracingTag.split("@");
        for(int i=0; i<scopesByTracingTag.length-1; i++){
          String scope = scopesByTracingTag[i];
          SubProcessActivity spAct = (SubProcessActivity)definition.getActivity(scope);
          List spInstanceIds = spAct.getSubprocessIds(instance);
          if(spInstanceIds.size() == 0){
            throw new UEngineException("Activity in the subprocess ["+ absoluteTracingTag +"] cannot be found.");
          }
         
          String spInstanceId = (String)spInstanceIds.get(0);
         
          instance = getProcessInstance(spInstanceId);
          definition = instance.getProcessDefinition();
        }
       
        tracingTag = scopesByTracingTag[scopesByTracingTag.length-1];
      }
     
      HumanActivity humanActivity = ((HumanActivity)definition.getActivity(tracingTag));
     
      if(!instance.isRunning(humanActivity.getTracingTag()) && !humanActivity.isNotificationWorkitem()){
        throw new UEngineException("Illegal completion for workitem [" + humanActivity + ":"+ humanActivity.getStatus(instance) +"]: Already closed or illegal status.");
      }
     
     
      if(saveOnly){
View Full Code Here

  public String getProcessDefinitionWithInstanceId(String instanceId, String encodingStyle) throws RemoteException{
    logInst("getProcessDefinitionWithInstanceId", new Object[]{instanceId, encodingStyle});
    try{
      //TODO don't need to serialize if encoding style is "Bean".
      ProcessInstance instance = getInstance(instanceId);
      ProcessDefinition def = instance.getProcessDefinition()
      ByteArrayOutputStream bao = new ByteArrayOutputStream();
      GlobalContext.serialize(def, bao, encodingStyle);
     
      return bao.toString(GlobalContext.DATABASE_ENCODING/*"ISO-8859-1"*/)
    }catch(Exception e){
View Full Code Here

  public ProcessDefinitionRemote getProcessDefinitionRemoteWithInstanceId(String instanceId) throws RemoteException{
    try{
      //TODO: sometimes there are illegal invocations from web server.
      if(instanceId==null) return null;
     
      ProcessInstance instance = getInstance(instanceId);
      ProcessDefinition definition = instance.getProcessDefinition();
     
      if(definition==null)
        throw new UEngineException("Can't find definition for this instance. Check if the definition file exists.");
       
      return new ProcessDefinitionRemote(definition, getTransactionContext());
View Full Code Here

  public ProcessDefinition getProcessDefinitionWithInstanceId(String instanceId) throws RemoteException{
    logInst("getProcessDefinitionWithInstanceId", new Object[]{instanceId});
    try{
      //ProcessInstanceRepositoryLocal pil = GlobalContext.createProcessInstanceRepositoryHomeLocal().findByPrimaryKey(new Long(instanceId));
     
      ProcessInstance instance = getInstance(instanceId);
      ProcessDefinition orginial = instance.getProcessDefinition();
     
      //ProcessDefinition orginial = getProcessDefinition(""+pil.getDefVerId());
       
      //Some EJB containers doesn't carry out serialization for object passing (especially in case that the caller is in the same VM).
      // So, it is required to make a copy so that the original object cannot be modified.
View Full Code Here

  }
 
  public void flowControl(String command, String instanceId, String tracingTag) throws RemoteException{
    logInst("flowControl", new Object[]{command, instanceId, tracingTag});
    try{
      ProcessInstance instance = getInstance(instanceId);
      ProcessDefinition definition = instance.getProcessDefinition();
     
      definition.flowControl(command, instance, tracingTag);
    }catch(Exception e){
      e.printStackTrace();
      throw new RemoteException("ProcessManagerError:"+e.getMessage(), e);
View Full Code Here

TOP

Related Classes of org.uengine.kernel.ProcessInstance

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.