Examples of TaskInstance


Examples of org.jbpm.taskmgmt.exe.TaskInstance

            }
            if (!(taskInstanceValue instanceof TaskInstance)) {
                context.setError("Error updating task", "Attempted to resume something other than a task instance");
                return;
            }
            final TaskInstance taskInstance = (TaskInstance) taskInstanceValue;
            final Date start;
            if (startDateExpression != null) {
                final Object startDateValue = startDateExpression.getValue(elContext);
                if (startDateValue == null) {
                    context.setError("Error updating task", "Start date value is null");
                    return;
                }
                if (startDateValue instanceof Date) {
                    start = (Date) startDateValue;
                } else if (startDateValue instanceof Long) {
                    start = new Date(((Long)startDateValue).longValue());
                } else {
                    context.setError("Error updating task", "Start date value is not a recognized type");
                    return;
                }
            } else {
                start = new Date();
            }
            taskInstance.setStart(start);
            context.getJbpmContext().getSession().flush();
        } catch (Exception ex) {
            context.setError("Error updating task", ex);
            return;
        }
View Full Code Here

Examples of org.jbpm.taskmgmt.exe.TaskInstance

    if (tasks != null && tasks.size() > 0)
    {
      log.info("cancel " + tasks.size() + " tasks");
      for (Iterator it = tasks.iterator(); it.hasNext();)
      {
        TaskInstance ti = (TaskInstance)it.next();

        // if the process def doesn't set signal="never", we have to
        // manually turn off signaling for all tasks;
        // otherwise, the token will be triggered instead of being
        // ended.
        // Do this until http://jira.jboss.com/jira/browse/JBPM-392 is
        // resolved

        log.info("cancel task " + ti.getId());
        ti.setSignalling(false);
        ti.cancel();
      }
    }
  }
View Full Code Here

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

Examples of org.jbpm.taskmgmt.exe.TaskInstance

            }
            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

Examples of org.jbpm.taskmgmt.exe.TaskInstance

                    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

Examples of org.jbpm.taskmgmt.exe.TaskInstance

    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

Examples of org.jbpm.taskmgmt.exe.TaskInstance

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

Examples of org.jbpm.taskmgmt.exe.TaskInstance

    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

Examples of org.jbpm.taskmgmt.exe.TaskInstance

    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

Examples of org.jbpm.taskmgmt.exe.TaskInstance

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
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.