Examples of TaskInstance


Examples of com.founder.fix.fixflow.core.task.TaskInstance

  public List<UserTaskBehavior> execute(CommandContext commandContext) {
   
   
    TaskManager taskManager = commandContext.getTaskManager();

    TaskInstance taskInstanceQuery = taskManager.findTaskById(taskId);
   
    if(taskId==null||taskId.equals("")){
      throw new FixFlowException("taskId不能为空");
    }

   
    if(taskInstanceQuery==null){
      throw new FixFlowException("没有查询到相关任务");
    }
   
    String tokenId = taskInstanceQuery.getTokenId();
    String processDefinitionId = taskInstanceQuery.getProcessDefinitionId();
    ProcessInstanceManager processInstanceManager = commandContext.getProcessInstanceManager();

    String processInstanceId = taskInstanceQuery.getProcessInstanceId();

    ProcessDefinitionManager processDefinitionManager = commandContext.getProcessDefinitionManager();

    ProcessDefinitionBehavior processDefinition = processDefinitionManager.findLatestProcessDefinitionById(processDefinitionId);
View Full Code Here

Examples of org.fireflow.engine.impl.TaskInstance

    if (workItem == null)
      return null;

    if (workItem.getState().intValue() != IWorkItem.INITIALIZED) {
      TaskInstance thisTaskInst = (TaskInstance) workItem
          .getTaskInstance();
      throw new EngineException(thisTaskInst.getProcessInstanceId(),
          thisTaskInst.getWorkflowProcess(),
          thisTaskInst.getTaskId(),
          "Claim work item failed. The state of the work item is "
              + workItem.getState());
    }
    if (workItem.getTaskInstance().getState().intValue() != ITaskInstance.INITIALIZED
        && workItem.getTaskInstance().getState().intValue() != ITaskInstance.RUNNING) {
      TaskInstance thisTaskInst = (TaskInstance) workItem
          .getTaskInstance();
      throw new EngineException(thisTaskInst.getProcessInstanceId(),
          thisTaskInst.getWorkflowProcess(),
          thisTaskInst.getTaskId(),
          "Claim work item failed .The state of the correspond task instance is "
              + workItem.getTaskInstance().getState());
    }

    if (workItem.getTaskInstance().isSuspended()) {
      TaskInstance thisTaskInst = (TaskInstance) workItem
          .getTaskInstance();
      throw new EngineException(thisTaskInst.getProcessInstanceId(),
          thisTaskInst.getWorkflowProcess(),
          thisTaskInst.getTaskId(),
          "Claim work item failed .The  correspond task instance is suspended");
    }

    // 0、首先修改workitem的状态
    ((WorkItem) workItem).setState(IWorkItem.RUNNING);
    ((WorkItem) workItem).setClaimedTime(rtCtx.getCalendarService()
        .getSysDate());
    persistenceService.saveOrUpdateWorkItem(workItem);

    // 1、如果不是会签,则删除其他的workitem
    if (FormTask.ANY.equals(workItem.getTaskInstance()
        .getAssignmentStrategy())) {
      persistenceService.deleteWorkItemsInInitializedState(workItem
          .getTaskInstance().getId());
    }

    // 2、将TaskInstance的canBeWithdrawn字段改称false。即不允许被撤销
    TaskInstance taskInstance = (TaskInstance) workItem.getTaskInstance();
    taskInstance.setCanBeWithdrawn(false);
    persistenceService.saveOrUpdateTaskInstance(taskInstance);

    return workItem;

  }
View Full Code Here

Examples of org.jbpm.taskmgmt.exe.TaskInstance

         @Override
         protected void renderResponse() throws Exception
         {
            List<TaskInstance> tasks = (List<TaskInstance>) getInstance(TaskInstanceList.class);
            assert tasks.size()==1;
            TaskInstance taskInstance = tasks.get(0);
            assert taskInstance.getDescription().equals("Kick Roy out of my office");
            taskId = taskInstance.getId();
         }
        
      }.run();

  
View Full Code Here

Examples of org.jbpm.taskmgmt.exe.TaskInstance

    //     Load it again, individually
    ProcessDefinition pd2 = graphSession.loadProcessDefinition(pd.getId());

    //     Create an instance of the Process Def with Task
    ProcessInstance processInstance = new ProcessInstance(pd2);
    TaskInstance jbpmTaskInstance = processInstance.getTaskMgmtInstance().createStartTaskInstance();

    //     Persist these changes
    graphSession.saveProcessInstance(processInstance);

    //     Be polite, like the template is.
View Full Code Here

Examples of org.jbpm.taskmgmt.exe.TaskInstance

                updatesMap = new UpdatesHashMap(processInstance.getContextInstance().getVariables());
            } else if (value instanceof Token) {
                final Token token = (Token) value;
                updatesMap = new UpdatesHashMap(token.getProcessInstance().getContextInstance().getVariables(token));
            } else if (value instanceof TaskInstance) {
                final TaskInstance task = (TaskInstance) value;
                updatesMap = new UpdatesHashMap(task.getVariables());
            } else if (value == null) {
                context.setError("Error getting variable map", "The value was given as null");
                return;
            } else {
                context.setError("Error getting variable map", "The value is not a recognized type");
View Full Code Here

Examples of org.jbpm.taskmgmt.exe.TaskInstance

            }
            final String name = nameValue.toString();
            final Object entity = entityExpression.getValue(elContext);
            final Object oldValue;
            if (entity instanceof TaskInstance) {
                final TaskInstance task = (TaskInstance) entity;
                oldValue = task.getVariable(name);
                task.deleteVariable(name);
            } else if (entity instanceof Token) {
                final Token token = (Token) entity;
                final ContextInstance contextInstance = token.getProcessInstance().getContextInstance();
                oldValue = contextInstance.getVariable(name, token);
                contextInstance.deleteVariable(name, token);
View Full Code Here

Examples of org.jbpm.taskmgmt.exe.TaskInstance

            // 3. If the start state has a default leaving transition, then
            // signal the token along the default transition.
            context.addSuccessMessage("Started process");

            final TaskMgmtInstance taskMgmtInstance = instance.getTaskMgmtInstance();
            final TaskInstance startTaskInstance = taskMgmtInstance.createStartTaskInstance();

            /* next piece causes NPE.
             * and i don't think it is needed to signal a new process automatically.  that can
             * be done in the console itself as well. 
             * TODO it would be nice if the console automatically navigated to the screen where
View Full Code Here

Examples of org.jbpm.taskmgmt.exe.TaskInstance

                for (String name : updates) {
                    contextInstance.setVariable(name, updatesHashMap.get(name), token);
                    updated = true;
                }
            } else if (targetValue instanceof TaskInstance) {
                final TaskInstance task = (TaskInstance) targetValue;
                for (String name : deletes) {
                    task.deleteVariable(name);
                    updated = true;
                }
                for (String name : updates) {
                    task.setVariable(name, updatesHashMap.get(name));
                    updated = true;
                }
            } else if (targetValue == null) {
                context.setError("Error updating variable map", "The target value was given as null");
                return;
View Full Code Here

Examples of org.jbpm.taskmgmt.exe.TaskInstance

  /**
   * get the task instance for a given task instance-id.
   */
  public TaskInstance loadTaskInstance(long taskInstanceId) {
    TaskInstance taskInstance = null;
    try {
      taskInstance = (TaskInstance) session.load(TaskInstance.class, new Long(taskInstanceId));
    }
    catch (Exception e) {
      handle(e);
View Full Code Here

Examples of org.jbpm.taskmgmt.exe.TaskInstance

  /**
   * get the task instance for a given task instance-id.
   */
  public TaskInstance getTaskInstance(long taskInstanceId) {
    TaskInstance taskInstance = null;
    try {
      taskInstance = (TaskInstance) session.get(TaskInstance.class, new Long(taskInstanceId));
    }
    catch (Exception e) {
      handle(e);
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.