Package org.openbp.server.context

Examples of org.openbp.server.context.WorkflowTask


    // The any workflow tasks that are associated with our process.
    WorkflowTaskCriteria criteria = new WorkflowTaskCriteria();
    criteria.setTokenContext(token);
    Iterator it = processFacade.getworkflowTasks(criteria);
    assertTrue(it.hasNext());
    WorkflowTask task = (WorkflowTask) it.next();

    TokenContext taskToken = task.getTokenContext();

    // Check the process variables of the token context
    Object p2 = taskToken.getProcessVariableValue("globalObject");
    assertTrue(p2 instanceof PersistedComplexParam);
    PersistedComplexParam rcp2 = (PersistedComplexParam) p2;
View Full Code Here


  public void executeModelObject(ModelObject mo, EngineExecutor ee)
  {
    TokenContext context = ee.getTokenContext();
    NodeSocket entrySocket = context.getCurrentSocket();

    WorkflowTask workflowTask = createWorkflowTask(entrySocket, context);

    // Continue with the 'TaskPublished' socket
    NodeSocket nextSocket = getEngine().resolveSocketRef(CoreConstants.SOCKET_TASK_PUBLISHED, entrySocket, context, false);

    if (nextSocket != null)
View Full Code Here

    TokenContextService contextService = getEngine().getTokenContextService();

    WorkflowNode node = (WorkflowNode) entrySocket.getNode();

    // Create a new workflow task
    WorkflowTask workflowTask = contextService.createWorkflowTask(context);

    // Update the current task from the entry socket and the prototype
    WorkflowTaskDescriptor prototype = node.getWorkflowTaskDescriptor();
    updateWorkflowTaskFromPrototype(workflowTask, entrySocket, context, prototype);

    // Update the creating user and creation date if not present already
    if (workflowTask.getCreatingUserId() == null)
    {
      workflowTask.setCreatingUserId(context.getUserId());
    }
    if (workflowTask.getTimeCreated() == null)
    {
      workflowTask.setTimeCreated(new Timestamp(System.currentTimeMillis()));
    }

    // This is an active workflow task now.
    workflowTask.setStatus(WorkflowTask.STATUS_ENABLED);

    workflowTask = contextService.addWorkflowTask(workflowTask);

    return workflowTask;
  }
View Full Code Here

    boolean deleteContext = context.isDeleteAfterCompletion();
    if (deleteContext)
    {
      for (Iterator itTask = tokenContextService.getworkflowTasks(criteria); itTask.hasNext();)
      {
        WorkflowTask workflowTask = (WorkflowTask) itTask.next();
        if (workflowTask.getId() != null)
        {
          if (! workflowTask.isDeleteAfterCompletion())
          {
            deleteContext = false;
          }
        }
      }
    }

    // End all child contexts.
    // Copy the list in order to prevent a concurrent modification exception
    for (Iterator it = tokenContextService.getChildContexts(context); it.hasNext();)
    {
      TokenContext childContext = (TokenContext) it.next();
      endToken(childContext);
    }

    TokenContext parentContext = context.getParentContext();
    if (parentContext != null)
    {
      parentContext.removeChildContext(context);
    }
    context.setParentContext(null);

    for (Iterator itTask = tokenContextService.getworkflowTasks(criteria); itTask.hasNext();)
    {
      WorkflowTask workflowTask = (WorkflowTask) itTask.next();
      if (workflowTask.getId() != null)
      {
        if (workflowTask.isDeleteAfterCompletion())
        {
          tokenContextService.deleteWorkflowTask(workflowTask);
        }
        else
        {
          workflowTask.setStatus(WorkflowTask.STATUS_COMPLETED);
          tokenContextService.saveWorkflowTask(workflowTask);
        }
      }
    }
View Full Code Here

    // Get the workflow task that is associated with our process.
    WorkflowTaskCriteria criteria = new WorkflowTaskCriteria();
    criteria.setTokenContext(token);
    Iterator it = getProcessFacade().getworkflowTasks(criteria);
    assertTrue(it.hasNext());
    WorkflowTask task = (WorkflowTask) it.next();

    TokenContext taskToken = task.getTokenContext();

    // Check the process variables of the token context
    Object p2 = taskToken.getProcessVariableValue("globalObject");
    assertTrue(p2 instanceof PersistedComplexParam);
    PersistedComplexParam rcp2 = (PersistedComplexParam) p2;
View Full Code Here

   * and a value greater than 0 if the argument is a string lexicographically less than this object.
   * @throws ClassCastException if the argument is not a WorkflowTask.
   */
  public int compareTo(final Object o)
  {
    WorkflowTask w1 = this;
    WorkflowTask w2 = (WorkflowTask) o;
    int ret;

    Integer p1 = new Integer(w1.getPriority());
    Integer p2 = new Integer(w2.getPriority());
    ret = CommonUtil.compareNull(p1, p2);
    if (ret != 0)
      return ret;

    Timestamp d1 = w1.getDueTime();
    Timestamp d2 = w2.getDueTime();
    ret = CommonUtil.compareNull(d1, d2);
    if (ret != 0)
      return ret;

    Timestamp c1 = w1.getTimeCreated();
    Timestamp c2 = w2.getTimeCreated();
    ret = CommonUtil.compareNull(c1, c2);
    if (ret != 0)
      return ret;

    String x1 = w1.getDisplayName();
    String x2 = w2.getDisplayName();
    ret = CommonUtil.compareNull(x1, x2);
    if (ret != 0)
      return ret;

    String y1 = w1.getName();
    String y2 = w2.getName();
    return CommonUtil.compareNull(y1, y2);
  }
View Full Code Here

TOP

Related Classes of org.openbp.server.context.WorkflowTask

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.