Examples of WorkflowException


Examples of org.apache.syncope.core.workflow.WorkflowException

        Task task;
        try {
            task = taskService.createTaskQuery().processInstanceId(workflowId).singleResult();
        } catch (ActivitiException e) {
            throw new WorkflowException("While reading form for workflow instance " + workflowId, e);
        }

        TaskFormData formData;
        try {
            formData = formService.getTaskFormData(task.getId());
View Full Code Here

Examples of org.apache.syncope.core.workflow.WorkflowException

        Map.Entry<Task, TaskFormData> checked = checkTask(taskId, username);

        if (!adminUser.equals(username)) {
            List<Task> tasksForUser = taskService.createTaskQuery().taskId(taskId).taskCandidateUser(username).list();
            if (tasksForUser.isEmpty()) {
                throw new WorkflowException(
                        new IllegalArgumentException(username + " is not candidate for task " + taskId));
            }
        }

        Task task;
        try {
            taskService.setOwner(taskId, username);
            task = taskService.createTaskQuery().taskId(taskId).singleResult();
        } catch (ActivitiException e) {
            throw new WorkflowException("While reading task " + taskId, e);
        }

        return getFormTO(task, checked.getValue());
    }
View Full Code Here

Examples of org.apache.syncope.core.workflow.WorkflowException

            throws WorkflowException {

        Map.Entry<Task, TaskFormData> checked = checkTask(form.getTaskId(), username);

        if (!checked.getKey().getOwner().equals(username)) {
            throw new WorkflowException(new IllegalArgumentException("Task " + form.getTaskId() + " assigned to "
                    + checked.getKey().getOwner() + " but submited by " + username));
        }

        SyncopeUser user = userDAO.findByWorkflowId(checked.getKey().getProcessInstanceId());
        if (user == null) {
            throw new NotFoundException("User with workflow id " + checked.getKey().getProcessInstanceId());
        }

        Set<String> preTasks = getPerformedTasks(user);
        try {
            formService.submitTaskFormData(form.getTaskId(), form.getPropertiesForSubmit());
        } catch (ActivitiException e) {
            throw new WorkflowException("While submitting form for task " + form.getTaskId(), e);
        }

        Set<String> postTasks = getPerformedTasks(user);
        postTasks.removeAll(preTasks);
        postTasks.add(form.getTaskId());
View Full Code Here

Examples of org.broadleafcommerce.core.workflow.WorkflowException

    /**
     * Creates the necessary context for cart operations
     */
    public ProcessContext<CartOperationRequest> createContext(CartOperationRequest seedData) throws WorkflowException {
        if (!(seedData instanceof CartOperationRequest)){
            throw new WorkflowException("Seed data instance is incorrect. " +
                    "Required class is " + CartOperationRequest.class.getName() + " " +
                    "but found class: " + seedData.getClass().getName());
        }
       
        ProcessContext<CartOperationRequest> context = new DefaultProcessContextImpl<CartOperationRequest>();
View Full Code Here

Examples of org.dspace.xmlworkflow.WorkflowException

    public Step getNextStep(Context context, XmlWorkflowItem wfi, Step currentStep, int outcome) throws IOException, WorkflowConfigurationException, WorkflowException, SQLException {
        String nextStepID = currentStep.getNextStepID(outcome);
        if(nextStepID != null){
            Step nextStep = getStep(nextStepID);
            if(nextStep == null)
                throw new WorkflowException("Error while processing outcome, the following action was undefined: " + nextStepID);
            if(nextStep.isValidStep(context, wfi)){
                return nextStep;
            } else {
                return getNextStep(context, wfi, nextStep, 0);
            }
View Full Code Here

Examples of org.geomajas.gwt.client.map.workflow.WorkflowException

      MapModelWorkflowContext mmContext = (MapModelWorkflowContext) context;
      FeatureTransaction ft = mmContext.getFeatureTransaction();
      if (ft.getNewFeatures() != null) {
        for (Feature feature : ft.getNewFeatures()) {
          if (!feature.getGeometry().isValid()) {
            throw new WorkflowException(I18nProvider.getGlobal().validationActivityError());
          }
        }
      }
    }
    return context;
View Full Code Here

Examples of org.huihoo.workflow.WorkflowException

      return;
    }

    if (trueTransitions.size() == 0)
    {
      throw new WorkflowException("signalOrJoinActivity trueTransitions.size()==0 ");
    }

    log.debug(
      "\n"
        + "dispActivity==>"
        + dispActivity
        + "\ntrueTransitions==>"
        + trueTransitions
        + "\nfalseTransitions==>"
        + falseTransitions
        + "\n\n");

    WorkflowProcess workflowProcess = dispWork.getWorkflowCase().getWorkflowProcess();

    WorkflowActivity trueJoinActivity = null;
    WorkflowActivity falseJoinActivity = null;
    WorkflowActivity orJoinActivity = null;

    List swap_trueTransitions = null;
    List swap_falseTransitions = null;

    //-------------------------------------------------------------------
    //  1.���� TRUE ·��ѡ�񷽰� ����TRUE TOKEN ����·��
    //-------------------------------------------------------------------

    trueJoinActivity = ((WorkflowTransition) trueTransitions.get(0)).getToWorkflowActivity();
    swap_trueTransitions = trueTransitions;

    boolean forceLoopTrueJoinActivity = false;
    boolean forceLoopFalseJoinActivity = false;

    LoopTrueJoinActivity : while (
      forceLoopTrueJoinActivity
        || (trueJoinActivity != null && !JoinType.JOIN_OR.equals(trueJoinActivity.getJoinType())))
    {
      forceLoopTrueJoinActivity = false;
      orJoinActivity = null;
     
      //---------------------------------------------------------------------------
      //  1.1 ���� TRUE ·��ѡ�񷽰�, ����next Activity û�� ׷�ݵ�OR Join Activity
      //  [����XPDL End Activity]
      //---------------------------------------------------------------------------
      swap_trueTransitions = trueJoinActivity.getOutgoingTransitions();
      if (swap_trueTransitions == null || swap_trueTransitions.size() == 0)
      {
        throw new WorkflowException("signalOrJoinActivity : outgoingTransitions.size()==0," + trueJoinActivity);
      }

      //---------------------------------------------------------------------------
      //  1.2 ���� TRUE ·��ѡ�񷽰�, ����next Activity û�� ׷�ݵ�OR Join Activity
      //  [��������XPDL �߼�����]
      //---------------------------------------------------------------------------
      trueJoinActivity = nextPossibleActivityFinder(trueJoinActivity, swap_trueTransitions);
      if (trueJoinActivity == null)
      {
        throw new WorkflowException("nextPossibleActivityFinder : nextOrJoinActivity is null");
      }

      //---------------------------------------------------------------------------
      //  1.3 ���� TRUE ·��ѡ�񷽰�, ѡ���next Acitivity ���� OR Join Activity
      //---------------------------------------------------------------------------
      if (!JoinType.JOIN_OR.equals(trueJoinActivity.getJoinType()))
      {
        //find next possible trueJoinActivity
        continue LoopTrueJoinActivity;
      }

      //---------------------------------------------------------------------------
      //  1.4 ���� TRUE ·��ѡ�񷽰�, ������ OR Join Activity
      //---------------------------------------------------------------------------
      log.debug("FOUND TRUE OR-JOIN-ACTIVITY : " +  trueJoinActivity.getInfo());

      //-------------------------------------------------------------------
      //  2.���� FALSE ·��ѡ�񷽰� ����FALSE TOKEN ����·��
      //------------------------------------------------------------------- 
      //---------------------------------------------------------------------------
      //  2.1 ���� FALSE ·��ѡ�񷽰�, �ַ�Activity next ·��ȫ����ѡ��
      //---------------------------------------------------------------------------
      swap_falseTransitions = falseTransitions;
      if (swap_falseTransitions == null || swap_falseTransitions.size() == 0)
      {
        //----------------------------------------
        // [����]  �������Ϸ��� OR Join Activity
        //----------------------------------------
        //or-split's all outTransitions are selected to process
        orJoinActivity = trueJoinActivity;
        break LoopTrueJoinActivity;
      }

      falseJoinActivity = ((WorkflowTransition) swap_falseTransitions.get(0)).getToWorkflowActivity();
      if(JoinType.JOIN_OR.equals(falseJoinActivity.getJoinType()))
      {
        //һ��OR Split  Activity ֱ�Ӻ�� Activity �� JoinType ��Ӧ��Ϊ OR
        throw new WorkflowException("Bad Format XPDL Data : OR Split Activity's next direct Activity's JoinType should not be 'OR'  ");
      }
     
      LoopFalseJoinActivity : while (
        forceLoopFalseJoinActivity
          || (falseJoinActivity != null && !JoinType.JOIN_OR.equals(falseJoinActivity.getJoinType())))
      {
        forceLoopFalseJoinActivity =false;
       
        swap_falseTransitions = falseJoinActivity.getOutgoingTransitions();
        //---------------------------------------------------------------------------
        //  2.2 ���� FLASE ·��ѡ�񷽰�, ���� next Activity û�� ׷�ݵ� OR Join Activity
        //      [����XPDL End Activity]
        //---------------------------------------------------------------------------
        if (swap_falseTransitions == null || swap_falseTransitions.size() == 0)
        {
          break LoopFalseJoinActivity;
        }

        falseJoinActivity = nextPossibleActivityFinder(falseJoinActivity, swap_falseTransitions);

        //---------------------------------------------------------------------------
        //  2.3 ���� FLASE ·��ѡ�񷽰�, ����next Activity û�� ׷�ݵ� OR Join Activity
        //      [��������XPDL �߼�����]
        //---------------------------------------------------------------------------
        if (falseJoinActivity == null)
        {
          break LoopFalseJoinActivity;
        }
        //---------------------------------------------------------------------------
        //  2.4 ���� FALSE ·��ѡ�񷽰�, ѡ���next Acitivity ���� OR Join Activity
        //      [����]  �ƶ� FALSE TOKEN ��ѡ����һ�� OR Join Activity ���в���
        //---------------------------------------------------------------------------
        if (!JoinType.JOIN_OR.equals(falseJoinActivity.getJoinType()))
        {
          //find next possible falseJoinActivity
          continue LoopFalseJoinActivity;
        }

        //---------------------------------------------------------------------------
        //  2.5 ���� FALSE ·��ѡ�񷽰�, ������ OR Join Activity
        //---------------------------------------------------------------------------
        log.debug("FOUND FALSE OR-JOIN-ACTIVITY : " + falseJoinActivity.getInfo());


        if (falseJoinActivity.getUUID().equals(trueJoinActivity.getUUID()))
        {
          //---------------------------------------------------------------------------
          //  2.6.1 ���� TRUE/FALSE ·��ѡ�񷽰�, ������ �Ϸ��� OR Join Activity
          //         [����]  �������Ϸ��� OR Join Activity
          //---------------------------------------------------------------------------
         
          //OR-JOIN Activity found
          orJoinActivity = falseJoinActivity;
          break LoopTrueJoinActivity;
        }
        else
        {
          //---------------------------------------------------------------------------
          //  2.6.2 ���� TRUE/FALSE ·��ѡ�񷽰�, û�м����� �Ϸ��� OR Join Activity
          //         [����]  �ƶ� FALSE TOKEN ��ѡ����һ�� OR Join Activity ���в���
          //---------------------------------------------------------------------------
          forceLoopFalseJoinActivity=true;
          continue LoopFalseJoinActivity;
        }

      } //~end while (falseJoinActivity != null && !JoinType.JOIN_OR.equals(falseJoinActivity.getJoinType()))

      //---------------------------------------------------------------------------
      //  1.5 ���� TRUE/FALSE ·��ѡ�񷽰�, û�м����� OR Join Activity
      //      [����] �ƶ� TRUE TOKEN ��ѡ����һ�� OR Join Activity ���в���
      //---------------------------------------------------------------------------               
      //find next possible orJoinActivity
      forceLoopTrueJoinActivity = true;
      continue LoopTrueJoinActivity;

      //------------------------------------------------------------------------------       
    } //~end while (trueJoinActivity != null && !JoinType.JOIN_OR.equals(trueJoinActivity.getJoinType()))

    if (orJoinActivity == null)
    {
      throw new WorkflowException("signalOrJoinActivity : orJoinActivity not found");
    }

    log.debug("orJoinActivity : " + orJoinActivity.getInfo());

    Connection conn = (Connection) userTransaction.getStoreConnection().get();
View Full Code Here

Examples of org.openengsb.core.workflow.api.WorkflowException

            factHandle = session.insert(event);
            workflowLock.lock();
            try {
                session.fireAllRules();
            } catch (ConsequenceException e) {
                throw new WorkflowException("ConsequenceException occured while processing event", e.getCause());
            } finally {
                workflowLock.unlock();
            }

            Set<Long> processIds = retrieveRelevantProcessInstanceIds(event, session);
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.