Package org.jbpm.pvm.internal.task

Examples of org.jbpm.pvm.internal.task.TaskImpl


    }
  }

  public Task execute(Environment environment) throws Exception {
    DbSession dbSession = environment.get(DbSession.class);
    TaskImpl task = (TaskImpl) dbSession.createTask();
    task.setSuperTaskDbid(parentTaskDbid);
    return task;
  }
View Full Code Here


      task.resume();
    }
  }

  public TaskImpl createTask() {
    TaskImpl task = newTask();
    task.setCreateTime(Clock.getCurrentTime());
    return task;
  }
View Full Code Here

    task.setCreateTime(Clock.getCurrentTime());
    return task;
  }

  protected TaskImpl newTask() {
    TaskImpl task = new TaskImpl();
    task.setNew(true);
    return task;
  }
View Full Code Here

    this.taskId = taskId;
  }

  public Void execute(Environment environment) throws Exception {
    DbSession dbSession = environment.get(DbSession.class);
    TaskImpl task = dbSession.get(TaskImpl.class, Long.parseLong(taskId));
    task.setVariables(variables);
  
    return null;
  }
View Full Code Here

  public Object execute(Environment environment) throws Exception {
    Session session = Environment.getFromCurrent(Session.class);
   
    if (taskId!=null) {
      TaskImpl task = (TaskImpl) session.get(TaskImpl.class, Long.parseLong(taskId));
      if (task==null) {
        throw new JbpmException("task "+taskId+" was not found");
      }

      task.addParticipation(userId, groupId, type);
    }

    /*
    if (swimlaneDbid!=null) {
      SwimlaneImpl swimlane = (TaskImpl) session.get(SwimlaneImpl.class, swimlaneDbid);
View Full Code Here

    execute((ExecutionImpl)execution);
  }

  public void execute(ExecutionImpl execution) {
    DbSession dbSession = Environment.getFromCurrent(DbSession.class);
    TaskImpl task = (TaskImpl) dbSession.createTask();
    task.setTaskDefinition(taskDefinition);
    task.setExecution(execution);
    task.setProcessInstance(execution.getProcessInstance());
    task.setSignalling(true);
   
    // initialize the name
    if (taskDefinition.getName()!=null) {
      task.setName(taskDefinition.getName());
    } else {
      task.setName(execution.getActivityName());
    }

    task.setDescription(taskDefinition.getDescription());
    task.setPriority(taskDefinition.getPriority());
    task.setFormResourceName(taskDefinition.getFormResourceName());
   
    // save task so that TaskDbSession.findTaskByExecution works for assign event listeners
    dbSession.save(task);

    SwimlaneDefinitionImpl swimlaneDefinition = taskDefinition.getSwimlaneDefinition();
    if (swimlaneDefinition!=null) {
      SwimlaneImpl swimlane = execution.getInitializedSwimlane(swimlaneDefinition);
      task.setSwimlane(swimlane);
     
      // copy the swimlane assignments to the task
      task.setAssignee(swimlane.getAssignee());
      for (ParticipationImpl participant: swimlane.getParticipations()) {
        task.addParticipation(participant.getUserId(), participant.getGroupId(), participant.getType());
      }
    }

    execution.initializeAssignments(taskDefinition, task);
   
View Full Code Here

   
    execution.fire(signalName, activity);

    DbSession taskDbSession = Environment
        .getFromCurrent(DbSession.class);
    TaskImpl task = (TaskImpl) taskDbSession.findTaskByExecution(execution);
    task.setSignalling(false);
   
    Transition transition = null;
    List<Transition> outgoingTransitions = activity.getOutgoingTransitions();
    if ( (outgoingTransitions!=null)
         && (!outgoingTransitions.isEmpty())
View Full Code Here

  public void notify(EventListenerExecution execution) throws Exception {
    // find current task
    Environment environment = Environment.getCurrent();
    DbSession dbSession = environment.get(DbSession.class);
    TaskImpl task = dbSession.findTaskByExecution(execution);

    // make task available to mail templates through task context
    TaskContext taskContext = new TaskContext(task);
    environment.setContext(taskContext);
    try {
View Full Code Here

    {
      TaskService taskService = processEngine.getTaskService();
      Task task = taskService.getTask(ref.getReferenceId());

      // access the processdefition
      TaskImpl cast = ((TaskImpl) task);
      ExecutionImpl processInstance = cast.getProcessInstance();
      String processInstanceId =  processInstance.getId();
      String processId =  processInstance.getProcessDefinition().getId();

      RepositoryService repoService = processEngine.getRepositoryService();
      ProcessDefinitionQuery query = repoService.createProcessDefinitionQuery();
View Full Code Here

   
    /* Every row is one queue element with jbpm task as first column and process instance as second */
       for(Object[] resultRow: queueResults)
       {
        
         TaskImpl taskInstance = (TaskImpl)resultRow[0];
         ProcessInstance processInstance = (ProcessInstance)resultRow[1];
        
         /* Map process and jbpm task to system's bpm task */
         BpmTask task = taskFactory.create(taskInstance, processInstance);
        
View Full Code Here

TOP

Related Classes of org.jbpm.pvm.internal.task.TaskImpl

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.