Package org.fireflow.engine

Examples of org.fireflow.engine.EngineException


    public IJoinPoint createJoinPoint(ISynchronizerInstance synchInst, IToken token) throws EngineException {

        int enterTransInstanceCount = synchInst.getEnteringTransitionInstances().size();
        if (enterTransInstanceCount == 0) {//检查流程定义是否合法,同步器节点必须有输入边

            throw new EngineException(this.getId(), this.getWorkflowProcess(),
                    synchInst.getSynchronizer().getId(), "The process definition [" + this.getName() + "] is invalid,the synchronizer[" + synchInst.getSynchronizer() + "] has no entering transition");
        }
        IPersistenceService persistenceService = rtCtx.getPersistenceService();
        //保存到数据库
        persistenceService.saveOrUpdateToken(token);
View Full Code Here


    /* (non-Javadoc)
     * @see org.fireflow.engine.IProcessInstance#run()
     */
    public void run() throws EngineException, KernelException {
        if (this.getState().intValue() != IProcessInstance.INITIALIZED) {
            throw new EngineException(this.getId(),
                    this.getWorkflowProcess(),
                    this.getProcessId(), "The state of the process instance is " + this.getState() + ",can not run it ");
        }

        INetInstance netInstance = rtCtx.getKernelManager().getNetInstance(this.getProcessId(), this.getVersion());
        if (netInstance == null) {
            throw new EngineException(this.getId(),
                    this.getWorkflowProcess(),
                    this.getProcessId(), "The net instance for the  workflow process [Id=" + this.getProcessId() + "] is Not found");
        }
        //触发事件
        ProcessInstanceEvent event = new ProcessInstanceEvent();
View Full Code Here

    /* (non-Javadoc)
     * @see org.fireflow.engine.IProcessInstance#abort()
     */
    public void abort() throws EngineException {
        if (this.state.intValue() == IProcessInstance.COMPLETED || this.state.intValue() == IProcessInstance.CANCELED) {
            throw new EngineException(this, this.getWorkflowProcess(), "The process instance can not be aborted,the state of this process instance is " + this.getState());
        }
        IPersistenceService persistenceService = rtCtx.getPersistenceService();
        persistenceService.abortProcessInstance(this);
    }
View Full Code Here

    /* (non-Javadoc)
     * @see org.fireflow.engine.IProcessInstance#suspend()
     */
    public void suspend() throws EngineException {
        if (this.state == IProcessInstance.COMPLETED || this.state == IProcessInstance.CANCELED) {
            throw new EngineException(this, this.getWorkflowProcess(), "The process instance can not be suspended,the state of this process instance is " + this.state);
        }
        if (this.isSuspended()) {
            return;
        }
        IPersistenceService persistenceService = this.rtCtx.getPersistenceService();
View Full Code Here

    /* (non-Javadoc)
     * @see org.fireflow.engine.IProcessInstance#restore()
     */
    public void restore() throws EngineException {
        if (this.state == IProcessInstance.COMPLETED || this.state == IProcessInstance.CANCELED) {
            throw new EngineException(this, this.getWorkflowProcess(), "The process instance can not be restored,the state of this process instance is " + this.state);
        }
        if (!this.isSuspended()) {
            return;
        }

View Full Code Here

    /* (non-Javadoc)
     * @see org.fireflow.engine.ITaskInstance#suspend()
     */
    public void suspend() throws EngineException {
        if (this.state==ITaskInstance.COMPLETED || this.state==ITaskInstance.CANCELED){
            throw new EngineException(this.getAliveProcessInstance(),this.getTask(),"The task instance can not be suspended,the state of this task instance is "+this.state);
        }
        if (this.isSuspended()){
            return;
        }
        this.setSuspended(Boolean.TRUE);
View Full Code Here

    /* (non-Javadoc)
     * @see org.fireflow.engine.ITaskInstance#restore()
     */
    public void restore() throws EngineException {
        if (this.state==ITaskInstance.COMPLETED || this.state==ITaskInstance.CANCELED){
            throw new EngineException(this.getAliveProcessInstance(),this.getTask(),"The task instance can not be restored,the state of this task instance is "+this.state);
        }
        if (!this.isSuspended()){
            return;
        }
        this.setSuspended(Boolean.FALSE);
View Full Code Here

  public void abort(String targetActivityId,
      DynamicAssignmentHandler dynamicAssignmentHandler)
      throws EngineException, KernelException {
   
      if (this.workflowSession==null){
        new EngineException(this.getProcessInstanceId(),
            this.getWorkflowProcess(),this.getTaskId(),
            "The current workflow session is null.");
      }
      if (this.rtCtx==null){
        new EngineException(this.getProcessInstanceId(),
            this.getWorkflowProcess(),this.getTaskId(),
            "The current runtime context is null.");       
      }
     
        if ((this.getState().intValue() == ITaskInstance.COMPLETED ) ||
            (this.getState().intValue()==ITaskInstance.CANCELED)) {
            throw new EngineException(this.getProcessInstanceId(), this.getWorkflowProcess(),
                    this.getTaskId(),
                    "Abort task instance failed . The state of the task instance [id=" + this.getId() + "] is " + this.getState());
        }     
     
      if (dynamicAssignmentHandler!=null){
View Full Code Here

   * @see org.fireflow.engine.ITaskInstance#abortEx(java.lang.String, org.fireflow.engine.taskinstance.DynamicAssignmentHandler)
   */
  public void abortEx(String targetActivityId,DynamicAssignmentHandler dynamicAssignmentHandler) throws EngineException,KernelException{
   
      if (this.workflowSession==null){
        new EngineException(this.getProcessInstanceId(),
            this.getWorkflowProcess(),this.getTaskId(),
            "The current workflow session is null.");
      }
      if (this.rtCtx==null){
        new EngineException(this.getProcessInstanceId(),
            this.getWorkflowProcess(),this.getTaskId(),
            "The current runtime context is null.");       
      }
     
        if ((this.getState().intValue() == ITaskInstance.COMPLETED ) ||
            (this.getState().intValue()==ITaskInstance.CANCELED)) {
            throw new EngineException(this.getProcessInstanceId(), this.getWorkflowProcess(),
                    this.getTaskId(),
                    "Abort task instance failed . The state of the task instance [id=" + this.getId() + "] is " + this.getState());
        }     
     
      if (dynamicAssignmentHandler!=null){
View Full Code Here

     * @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.FORM.equals(taskInstance.getTaskType())){
                    throw new EngineException(processInstance,
                            taskInstance.getActivity(),
                            "DefaultFormTaskInstanceRunner:TaskInstance的任务类型错误,只能为FORM类型");
                }

                DynamicAssignmentHandler dynamicAssignmentHandler = ((WorkflowSession)currentSession).consumeCurrentDynamicAssignmentHandler();
                FormTask task = (FormTask)taskInstance.getTask();

                Participant performer = task.getPerformer();//获取到form的执行者
                if (performer == null || performer.getAssignmentHandler().trim().equals("")) {
                    throw new EngineException(processInstance,
                            taskInstance.getActivity(),
                            "流程定义错误,Form类型的 task必须指定performer及其AssignmentHandler");
                }
                assign(currentSession,processInstance,runtimeContext,taskInstance, task, performer, dynamicAssignmentHandler);
    }
View Full Code Here

TOP

Related Classes of org.fireflow.engine.EngineException

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.