Package org.jbpm.taskmgmt.exe

Examples of org.jbpm.taskmgmt.exe.TaskInstance


  {
  }

  public Object execute(JbpmContext jbpmContext) throws Exception
  {
    TaskInstance ti = jbpmContext.getTaskInstance(taskInstanceId);
    ti.setActorId(null);
    ti.setStart(null);
    return null;
  }
View Full Code Here


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

                    forUpdate = Boolean.parseBoolean(forUpdateValue.toString());
                }
            } else {
                forUpdate = event.getPhaseId() != PhaseId.RENDER_RESPONSE;
            }
            final TaskInstance taskInstance;
            if (forUpdate) {
                taskInstance = context.getJbpmContext().getTaskInstanceForUpdate(id);
            } else {
                taskInstance = context.getJbpmContext().getTaskInstance(id);
            }
View Full Code Here

    contextInstance = processInstance.getContextInstance();
   
    assertEquals("value a", contextInstance.getVariable("a") );
    assertEquals("value b updated", contextInstance.getVariable("b") );
   
    TaskInstance taskInstance = (TaskInstance) processInstance.getTaskMgmtInstance().getTaskInstances().iterator().next();
    assertEquals("value a updated", taskInstance.getVariable("a") );
    assertEquals("value b updated", taskInstance.getVariable("b") );
  }
View Full Code Here

  TaskInstance taskInstance = null;
 
  public void setUp() throws Exception {
    super.setUp();
   
    taskInstance = new TaskInstance();
    session.save(taskInstance);
  }
View Full Code Here

    log.info("");
    log.info("=== PERFORMING TASK ONE =======================================================");
    log.info("");
    List taskList = jbpmContext.getTaskList("ernie");
    assertEquals(1, taskList.size());
    TaskInstance taskInstance = (TaskInstance) taskList.get(0);
    taskInstance.setVariable("item", "cookies");
    taskInstance.end();

    newTransaction();
   
    log.info("");
    log.info("=== PERFORMING TASK TWO =======================================================");
    log.info("");
    taskList = jbpmContext.getTaskList("ernie");
    assertEquals(1, taskList.size());
    taskInstance = (TaskInstance) taskList.get(0);
    taskInstance.setVariable("delivery address", "sesame street");
    taskInstance.end();
  }
View Full Code Here

    return tmi.getUnfinishedTasks(token).size();
  }

  public static void endOneTask(Token token) {
    TaskMgmtInstance tmi = (TaskMgmtInstance)token.getProcessInstance().getInstance(TaskMgmtInstance.class);
    TaskInstance taskInstance = (TaskInstance) tmi.getUnfinishedTasks(token).iterator().next();
    taskInstance.end();
  }
View Full Code Here

public class TasklistEagerLoadingTest extends AbstractDbTestCase {

  public void testTasklistEagerLoading() {
    for (int i=0; i<20; i++) {
      TaskInstance taskInstance = new TaskInstance("task "+i);
      taskInstance.setActorId("johndoe");
      session.save(taskInstance);
    }
    newTransaction();
   
    assertEquals(20, jbpmContext.getTaskList("johndoe").size());
View Full Code Here

    assertEquals(20, jbpmContext.getTaskList("johndoe").size());
  }

  public void testPooledTasklistEagerLoading() {
    for (int i=0; i<20; i++) {
      TaskInstance taskInstance = new TaskInstance("group task "+i);
      taskInstance.setPooledActors(new String[]{"group"+i});
      session.save(taskInstance);
    }
    for (int i=0; i<20; i++) {
      TaskInstance taskInstance = new TaskInstance("task "+i);
      taskInstance.setPooledActors(new String[]{"johndoe", "bachelors", "partyanimals", "wildwomen"});
      session.save(taskInstance);
    }
    newTransaction();
   
    List actorIds = new ArrayList();
View Full Code Here

    // database with the methods in the org.jbpm.db.TaskMgmtSession.
    // Since we don't want to include the persistence complexity in
    // this example, we just take the first task-instance of this
    // process instance (we know there is only one in this test
    // scenario.
    TaskInstance taskInstance = (TaskInstance
        processInstance
          .getTaskMgmtInstance()
          .getTaskInstances()
          .iterator().next();

    // Now, we check if the taskInstance was actually assigned to 'papa'.
    assertEquals("papa", taskInstance.getActorId() );
   
    // Now suppose that 'papa' has done his duties and marks the task
    // as done.
    taskInstance.end();
    // Since this was the last (only) task to do, the completion of this
    // task triggered the continuation of the process instance execution.
   
    assertSame(processDefinition.getNode("end"), token.getNode());
  }
View Full Code Here

TOP

Related Classes of org.jbpm.taskmgmt.exe.TaskInstance

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.