Package org.uengine.kernel

Examples of org.uengine.kernel.UEngineException


      if(productionVersionId==null || ((Long)productionVersionId).longValue()==-1)
        throw new RemoteException("ProcessManagerError: There's no production. Make sure you have chosen a version of the process definition as production at least once.");
             
      return productionVersionId.toString();
    }catch(ObjectNotFoundException onfe){
      UEngineException ue = new UEngineException("No such processdefinition with name '" + pdName +"'.", onfe);
      throw new RemoteException("ProcessManagerError:" + ue.getMessage(), ue);
    }catch(Exception e){
      e.printStackTrace();
      throw new RemoteException("ProcessManagerError:"+e.getMessage(), e);
    }
  }
View Full Code Here


      if(productionVersionId==null || ((Long)productionVersionId).longValue()==-1)
        throw new RemoteException("ProcessManagerError: There's no production. Make sure you have chosen a version of the process definition as production at least once.");
             
      return productionVersionId.toString();
    }catch(ObjectNotFoundException onfe){
      UEngineException ue = new UEngineException("No such processdefinition with alias '" + alias +"'.", onfe);
      throw new RemoteException("ProcessManagerError:" + ue.getMessage(), ue);
    }catch(Exception e){
      e.printStackTrace();
      throw new RemoteException("ProcessManagerError:"+e.getMessage(), e);
    }
  }
View Full Code Here

      ProcessDefinitionRepositoryHomeLocal pdhr = GlobalContext.createProcessDefinitionRepositoryHomeLocal(getTransactionContext());
      ProcessDefinitionRepositoryLocal pdlr = pdhr.findByAlias(alias);
     
      return pdlr.getDefId().toString();
    }catch(ObjectNotFoundException onfe){
      UEngineException ue = new UEngineException("No such processdefinition with alias '" + alias +"'.", onfe);
      throw new RemoteException("ProcessManagerError:" + ue.getMessage(), ue);
    }catch(Exception e){
      e.printStackTrace();
      throw new RemoteException("ProcessManagerError:"+e.getMessage(), e);
    }
  }
View Full Code Here

 

  public Serializable getActivityProperty(String processDefinition, String tracingTag, String propertyName) throws RemoteException{
    log("getActivityProperty", new Object[]{processDefinition, tracingTag, propertyName});
    try{     
      if(!UEngineUtil.isNotEmpty(processDefinition)) throw new UEngineException("Check the definition id");
     
      ProcessDefinition definition = getDefinition(processDefinition);
      Activity activity = definition.getActivity(tracingTag);
      propertyName = propertyName.substring(0,1).toUpperCase() + propertyName.substring(1);//.toLowerCase();
      Object returnVal = activity.getClass().getMethod("get" + propertyName, new Class[]{}).invoke(activity, new Object[]{});
View Full Code Here

        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){
        humanActivity.saveWorkItem(instance, payload);
      }else{
        try{
          humanActivity.fireReceived(instance, payload);
        }catch(Exception e){
          humanActivity.fireFault(instance, e);
         
          throw new UEngineException(e.getMessage(), null, new UEngineException(e.getMessage(), e), instance, humanActivity);
        }
      }
   
      /*String message = humanActivity.getMessage();
           
View Full Code Here

     
      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());
    }catch(Exception e){
      e.printStackTrace();
      throw new RemoteException("ProcessManagerError:"+e.getMessage(), e);
View Full Code Here

        returnVal = activity.getClass().getMethod("get" + propertyName, new Class[]{ProcessInstance.class}).invoke(activity, new Object[]{instance});
      }catch(NoSuchMethodException e){
        try{
          returnVal = activity.getClass().getMethod("is" + propertyName, new Class[]{ProcessInstance.class}).invoke(activity, new Object[]{instance});
        }catch(NoSuchMethodException msme){
          throw new UEngineException("No such activity property named as '" + propertyName + "'");
        }
      }

      return (Serializable)returnVal;
    }catch(Exception e){
View Full Code Here

    logInst("setActivityInstanceProperty", new Object[]{instanceId, tracingTag, propertyName, value, valueType});
    try{     
      if(instanceId==null) return; //guard against illegal requests
      if(valueType==null){
        if(value==null)
          throw new UEngineException("Property value should be not null. If you want to apply with null value, provide valueType as well."); //TODO: change to find proper method and to allow null value
         
        valueType = value.getClass();
      }      

      ProcessInstance instance = getInstance(instanceId);
      ProcessDefinition definition = instance.getProcessDefinition();
     
      if(definition==null)
        throw new UEngineException("Can't find the definition for instance '" + instance.getInstanceId() + "'");
       
      Activity activity = definition.getActivity(tracingTag);

      if(activity==null)
        throw new UEngineException("No such activity with tracing tag : " + tracingTag + " in definition '" + definition.getId() + "'");

      propertyName = propertyName.substring(0,1).toUpperCase() + propertyName.substring(1);//.toLowerCase();
      //the pattern of instance property (stateful) setting method is 'setXXX(instance, value)'                       
      activity.getClass().getMethod("set" + propertyName, new Class[]{ProcessInstance.class, valueType}).invoke(activity, new Object[]{instance, value});
    }catch(Exception e){
View Full Code Here

    logInst("doActivityAction", new Object[]{instanceId, tracingTag, actionName, parameters, parameterTypes});
    try{     
      if(instanceId==null) return null; //guard against illegal requests
     
      if(parameters.length!=parameterTypes.length)
        throw new UEngineException("invalid parameter length");

      ProcessInstance instance = getInstance(instanceId);
      ProcessDefinition definition = instance.getProcessDefinition();
     
      if(definition==null)
        throw new UEngineException("Can't find the definition for instance '" + instance.getInstanceId() + "'");
       
      Activity activity = definition.getActivity(tracingTag);

      if(activity==null)
        throw new UEngineException("No such activity with tracing tag : " + tracingTag + " in definition '" + definition.getId() + "'");

      Class[] actualParameterTypes = new Class[parameterTypes.length+1];
      actualParameterTypes[0] = ProcessInstance.class;
      System.arraycopy(parameterTypes, 0, actualParameterTypes, 1, parameterTypes.length);
View Full Code Here

      //Check there is referencing instance
      ProcessInstanceRepositoryHomeLocal pihr = GlobalContext.createProcessInstanceRepositoryHomeLocal();
      //if there is any of instance of this folder, this definition can't be removed
      Collection pis = pihr.findByDefinition(new Long(processDefinition));
      if(pis.iterator().hasNext())
        throw new UEngineException("This definition has instances");

      ProcessDefinitionFactory.getInstance(getTransactionContext()).removeDefinition(processDefinition);     
    }catch(Exception e){
      e.printStackTrace();
      throw new RemoteException("ProcessManagerError:"+e.getMessage(), e);
View Full Code Here

TOP

Related Classes of org.uengine.kernel.UEngineException

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.