Examples of EngineException


Examples of org.fireflow.engine.EngineException

     * @see org.fireflow.engine.taskinstance.ITaskInstanceRunner#run(org.fireflow.engine.IWorkflowSession, org.fireflow.engine.RuntimeContext, org.fireflow.engine.IProcessInstance, org.fireflow.engine.ITaskInstance)
     */
    public void run(IWorkflowSession currentSession, RuntimeContext runtimeContext, IProcessInstance processInstance,
            ITaskInstance taskInstance) throws EngineException, KernelException {
        if (!Task.TOOL.equals(taskInstance.getTaskType())) {
            throw new EngineException(processInstance,
                    taskInstance.getActivity(),
                    "DefaultToolTaskInstanceRunner:TaskInstance的任务类型错误,只能为TOOL类型");
        }
        Task task = taskInstance.getTask();
        if (task == null) {
            WorkflowProcess process = taskInstance.getWorkflowProcess();
            throw new EngineException(taskInstance.getProcessInstanceId(), process,
                    taskInstance.getTaskId(),
                    "The Task is null,can NOT start the taskinstance,");
        }
        if (((ToolTask) task).getApplication() == null || ((ToolTask) task).getApplication().getHandler() == null) {
            WorkflowProcess process = taskInstance.getWorkflowProcess();
            throw new EngineException(taskInstance.getProcessInstanceId(), process,
                    taskInstance.getTaskId(),
                    "The task.getApplication() is null or task.getApplication().getHandler() is null,can NOT start the taskinstance,");
        }

        Object obj = runtimeContext.getBeanByName(((ToolTask) task).getApplication().getHandler());

        if (obj==null || !(obj instanceof IApplicationHandler)){
            WorkflowProcess process = taskInstance.getWorkflowProcess();
            throw new EngineException(taskInstance.getProcessInstanceId(), process,
                    taskInstance.getTaskId(),
                    "Run tool task instance error! Not found the instance of "+((ToolTask) task).getApplication().getHandler()+" or the instance not implements IApplicationHandler");
           
        }

        try {
            ((IApplicationHandler) obj).execute(taskInstance);
        } catch (Exception e) {
            //TODO wmj2003 对tool类型的task抛出的错误应该怎么处理? 这个时候引擎会如何?整个流程是否还可以继续?
          e.printStackTrace();
            throw new EngineException(processInstance,
                    taskInstance.getActivity(),
                    "DefaultToolTaskInstanceRunner:TaskInstance的任务执行失败!");
        }

        ITaskInstanceManager taskInstanceManager = runtimeContext.getTaskInstanceManager();
View Full Code Here

Examples of org.fireflow.engine.EngineException

    /* (non-Javadoc)
     * @see org.fireflow.engine.IWorkItem#withdraw()
     */
    public IWorkItem withdraw() throws EngineException, KernelException {
      if (this.workflowSession==null){
        new EngineException(this.getTaskInstance().getProcessInstanceId(),
            this.getTaskInstance().getWorkflowProcess(),this.getTaskInstance().getTaskId(),
            "The current workflow session is null.");
      }
      if (this.rtCtx==null){
        new EngineException(this.getTaskInstance().getProcessInstanceId(),
            this.getTaskInstance().getWorkflowProcess(),this.getTaskInstance().getTaskId(),
            "The current runtime context is null.");       
      }     
        ITaskInstanceManager taskInstanceMgr = this.rtCtx.getTaskInstanceManager();
        return taskInstanceMgr.withdrawWorkItem(this);
View Full Code Here

Examples of org.fireflow.engine.EngineException

    /* (non-Javadoc)
     * @see org.fireflow.engine.IWorkItem#reject(java.lang.String)
     */
    public void reject(String comments) throws EngineException, KernelException {
      if (this.workflowSession==null){
        new EngineException(this.getTaskInstance().getProcessInstanceId(),
            this.getTaskInstance().getWorkflowProcess(),this.getTaskInstance().getTaskId(),
            "The current workflow session is null.");
      }
      if (this.rtCtx==null){
        new EngineException(this.getTaskInstance().getProcessInstanceId(),
            this.getTaskInstance().getWorkflowProcess(),this.getTaskInstance().getTaskId(),
            "The current runtime context is null.");       
      }     
        ITaskInstanceManager taskInstanceMgr = this.rtCtx.getTaskInstanceManager();
        taskInstanceMgr.rejectWorkItem(this,comments);
View Full Code Here

Examples of org.fireflow.engine.EngineException

   * @see org.fireflow.engine.IWorkItem#complete(org.fireflow.engine.taskinstance.DynamicAssignmentHandler, java.lang.String)
   */
  public void complete(DynamicAssignmentHandler dynamicAssignmentHandler, String comments)
      throws EngineException, KernelException {
      if (this.workflowSession==null){
        new EngineException(this.getTaskInstance().getProcessInstanceId(),
            this.getTaskInstance().getWorkflowProcess(),this.getTaskInstance().getTaskId(),
            "The current workflow session is null.");
      }
      if (this.rtCtx==null){
        new EngineException(this.getTaskInstance().getProcessInstanceId(),
            this.getTaskInstance().getWorkflowProcess(),this.getTaskInstance().getTaskId(),
            "The current runtime context is null.");       
      }

        if (this.getState().intValue() != IWorkItem.RUNNING) {
            TaskInstance thisTaskInst = (TaskInstance) this.getTaskInstance();
//      System.out.println("WorkItem的当前状态为"+this.getState()+",不可以执行complete操作。");
            throw new EngineException(thisTaskInst.getProcessInstanceId(), thisTaskInst.getWorkflowProcess(),
                    thisTaskInst.getTaskId(),
                    "Complete work item failed . The state of the work item [id=" + this.getId() + "] is " + this.getState());
        }     
     
      if (dynamicAssignmentHandler!=null){
View Full Code Here

Examples of org.fireflow.engine.EngineException

    /* (non-Javadoc)
     * @see org.fireflow.engine.IWorkItem#reassignTo(java.lang.String, java.lang.String)
     */
    public IWorkItem reassignTo(String actorId, String comments) throws EngineException{
      if (this.workflowSession==null){
        new EngineException(this.getTaskInstance().getProcessInstanceId(),
            this.getTaskInstance().getWorkflowProcess(),this.getTaskInstance().getTaskId(),
            "The current workflow session is null.");
      }
      if (this.rtCtx==null){
        new EngineException(this.getTaskInstance().getProcessInstanceId(),
            this.getTaskInstance().getWorkflowProcess(),this.getTaskInstance().getTaskId(),
            "The current runtime context is null.");       
      }
   
        ITaskInstanceManager manager = this.rtCtx.getTaskInstanceManager();
View Full Code Here

Examples of org.fireflow.engine.EngineException

    /* (non-Javadoc)
     * @see org.fireflow.engine.IWorkItem#claim()
     */
    public IWorkItem claim() throws EngineException, KernelException {
      if (this.workflowSession==null){
        new EngineException(this.getTaskInstance().getProcessInstanceId(),
            this.getTaskInstance().getWorkflowProcess(),this.getTaskInstance().getTaskId(),
            "The current workflow session is null.");
      }
      if (this.rtCtx==null){
        new EngineException(this.getTaskInstance().getProcessInstanceId(),
            this.getTaskInstance().getWorkflowProcess(),this.getTaskInstance().getTaskId(),
            "The current runtime context is null.");       
      }
 
     
View Full Code Here

Examples of org.fireflow.engine.EngineException

    /* (non-Javadoc)
     * @see org.fireflow.engine.IWorkItem#jumpTo(java.lang.String, org.fireflow.engine.taskinstance.DynamicAssignmentHandler, java.lang.String)
     */
    public void jumpTo(String targetActivityId, DynamicAssignmentHandler dynamicAssignmentHandler, String comments) throws EngineException, KernelException {
      if (this.workflowSession==null){
        new EngineException(this.getTaskInstance().getProcessInstanceId(),
            this.getTaskInstance().getWorkflowProcess(),this.getTaskInstance().getTaskId(),
            "The current workflow session is null.");
      }
      if (this.rtCtx==null){
        new EngineException(this.getTaskInstance().getProcessInstanceId(),
            this.getTaskInstance().getWorkflowProcess(),this.getTaskInstance().getTaskId(),
            "The current runtime context is null.");       
      }
      if (dynamicAssignmentHandler!=null){
        this.workflowSession.setDynamicAssignmentHandler(dynamicAssignmentHandler);
View Full Code Here

Examples of org.formulacompiler.runtime.EngineException

      assert this.factoryClass.getClassLoader() == classLoader: "Class loader mismatch";
      this.factoryConstructor = this.factoryClass.getDeclaredConstructor( Environment.class );
      this.defaultFactory = this.factoryConstructor.newInstance( Environment.DEFAULT );
    }
    catch (ClassNotFoundException e) {
      throw new EngineException( e );
    }
    catch (InstantiationException e) {
      throw new EngineException( e );
    }
    catch (IllegalAccessException e) {
      throw new EngineException( e );
    }
    catch (SecurityException e) {
      throw new EngineException( e );
    }
    catch (NoSuchMethodException e) {
      throw new EngineException( e );
    }
    catch (InvocationTargetException e) {
      throw new EngineException( e );
    }
  }
View Full Code Here

Examples of org.nlogo.nvm.EngineException

      Agent a2 = (Agent) o2;
      if (a1.getAgentBit() == a2.getAgentBit()) {
        return a1.compareTo(a2) <= 0;
      }
    }
    throw new EngineException(context, this,
        I18N.errorsJ().getN("org.nlogo.prim._lessorequal.cannotCompareParameters",
            TypeNames.aName(o1), TypeNames.aName(o2)));
  }
View Full Code Here

Examples of org.openbp.core.engine.EngineException

      }
    }
    if (mustExist)
    {
      String msg = LogUtil.error(getClass(), "Trying to access undefined process variable $0.", variableName);
      throw new EngineException("UndefinedProcessVariable", msg);
    }

    // Unknown process variable will cause result null in relaxed mode
    return null;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.