Package org.uengine.kernel

Examples of org.uengine.kernel.ProcessDefinition


 
  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:
      //return null;
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();
      throw new RemoteException("ProcessManagerError:"+e.getMessage(), e);
    }
View Full Code Here

      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.");
      }
     
View Full Code Here

  }
 
  public String getProcessDefinition(String processDefinition, String encodingStyle) throws RemoteException{
    log("getProcessDefinition", new Object[]{processDefinition, encodingStyle});
    try{
      ProcessDefinition def = getDefinition(processDefinition);
     
      ByteArrayOutputStream bao = new ByteArrayOutputStream();
     
      //TODO if encoding style is bean this process is not required.
      GlobalContext.serialize(def, bao, encodingStyle);
View Full Code Here

   * This method is costly to call. Use getProcessDefinitionRemote() instead if full data is not neccessary.
   */
  public ProcessDefinition getProcessDefinition(String processDefinition) throws RemoteException{
    log("getProcessDefinition", new Object[]{processDefinition});
    try{
      ProcessDefinition copy = (ProcessDefinition)getDefinition(processDefinition).clone();      
      return copy;   
    }catch(Exception e){
      e.printStackTrace();
      throw new RemoteException("ProcessManagerError:"+e.getMessage(), e);
    }
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

      int productionVersion = pdl.getProdVer();
     
      ProcessDefinitionRemote pdr =null;
     
      try{
        ProcessDefinition pd = getDefinition(pdvid);
        if(pd !=null && pd instanceof ProcessDefinition){
          pdr = new ProcessDefinitionRemote(pd, getTransactionContext(), pdvrl);
         
          if(pdl.getObjType() != null){
            pdr.setObjType(pdl.getObjType());
View Full Code Here

    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

    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.
      return (ProcessDefinition)orginial.clone();
    }catch(Exception e){
      e.printStackTrace();
      throw new RemoteException("ProcessManagerError:"+e.getMessage(), e);
    }
  }
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.ProcessDefinition

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.