Package org.activiti.engine.impl.persistence.entity

Examples of org.activiti.engine.impl.persistence.entity.TaskEntity


    /**
     * 委托任务.
     *
     */
    public Void execute(CommandContext commandContext) {
        TaskEntity task = Context.getCommandContext().getTaskEntityManager()
                .findTaskById(taskId);

        String assignee = task.getAssignee();

        if (task.getOwner() == null) {
            task.setOwner(assignee);
        }

        task.setAssignee(attorney);
        ApplicationContextHelper.getBean(DelegateService.class).saveRecord(
                assignee, attorney, taskId);

        return null;
    }
View Full Code Here


                    && ((noticeDate.getTime() - now.getTime()) < (60 * 1000))) {
                UserConnector userConnector = ApplicationContextHelper
                        .getBean(UserConnector.class);
                MailFacade mailFacade = ApplicationContextHelper
                        .getBean(MailFacade.class);
                TaskEntity taskEntity = new TaskEntity();
                taskEntity.setId(delegateTask.getId());
                taskEntity.setName(delegateTask.getName());
                taskEntity.setAssigneeWithoutCascade(userConnector.findById(
                        delegateTask.getAssignee()).getDisplayName());
                taskEntity.setVariableLocal("initiator",
                        getInitiator(userConnector, delegateTask));

                String receiver = bpmConfNotice.getReceiver();
                BpmMailTemplate bpmMailTemplate = bpmConfNotice
                        .getBpmMailTemplate();
View Full Code Here

            BpmConfNotice bpmConfNotice) {
        UserConnector userConnector = ApplicationContextHelper
                .getBean(UserConnector.class);
        MailFacade mailFacade = ApplicationContextHelper
                .getBean(MailFacade.class);
        TaskEntity taskEntity = new TaskEntity();
        taskEntity.setId(delegateTask.getId());
        taskEntity.setName(delegateTask.getName());
        taskEntity.setAssigneeWithoutCascade(userConnector.findById(
                delegateTask.getAssignee()).getDisplayName());
        taskEntity.setVariableLocal("initiator",
                getInitiator(userConnector, delegateTask));

        String receiver = bpmConfNotice.getReceiver();
        BpmMailTemplate bpmMailTemplate = bpmConfNotice.getBpmMailTemplate();
        ExpressionManager expressionManager = Context
View Full Code Here

        historicTaskInstanceEntity.setEndTime(null);
        historicTaskInstanceEntity.setDurationInMillis(null);
        historicActivityInstanceEntity.setEndTime(null);
        historicActivityInstanceEntity.setDurationInMillis(null);

        TaskEntity task = TaskEntity.create(new Date());
        task.setProcessDefinitionId(historicTaskInstanceEntity
                .getProcessDefinitionId());
        task.setId(historicTaskInstanceEntity.getId());
        task.setAssigneeWithoutCascade(historicTaskInstanceEntity.getAssignee());
        task.setParentTaskIdWithoutCascade(historicTaskInstanceEntity
                .getParentTaskId());
        task.setNameWithoutCascade(historicTaskInstanceEntity.getName());
        task.setTaskDefinitionKey(historicTaskInstanceEntity
                .getTaskDefinitionKey());
        task.setExecutionId(historicTaskInstanceEntity.getExecutionId());
        task.setPriority(historicTaskInstanceEntity.getPriority());
        task.setProcessInstanceId(historicTaskInstanceEntity
                .getProcessInstanceId());
        task.setDescriptionWithoutCascade(historicTaskInstanceEntity
                .getDescription());

        Context.getCommandContext().getTaskEntityManager().insert(task);

        ExecutionEntity executionEntity = Context.getCommandContext()
View Full Code Here

    public SendNoticeCmd(String taskId) {
        this.taskId = taskId;
    }

    public Void execute(CommandContext commandContext) {
        TaskEntity delegateTask = commandContext.getTaskEntityManager()
                .findTaskById(taskId);
        new TimeoutNotice().process(delegateTask);

        return null;
    }
View Full Code Here

    public Object execute(CommandContext commandContext) {
        this.commandContext = commandContext;

        if (this.taskId != null) {
            TaskEntity taskEntity = commandContext.getTaskEntityManager()
                    .findTaskById(taskId);
            activityId = taskEntity.getExecution().getActivityId();
            processInstanceId = taskEntity.getProcessInstanceId();
            this.collectionVariableName = "countersignUsers";
            this.collectionElementVariableName = "countersignUser";
        }

        if (operateType.equalsIgnoreCase("add")) {
View Full Code Here

        this.variables = variables;
        this.comment = comment;
    }

    public Object execute(CommandContext commandContext) {
        TaskEntity taskEntity = commandContext.getTaskEntityManager()
                .findTaskById(taskId);

        if (variables != null) {
            taskEntity.setExecutionVariables(variables);
        }

        taskEntity.fireEvent(TaskListener.EVENTNAME_COMPLETE);

        if ((Authentication.getAuthenticatedUserId() != null)
                && (taskEntity.getProcessInstanceId() != null)) {
            taskEntity.getProcessInstance().involveUser(
                    Authentication.getAuthenticatedUserId(),
                    IdentityLinkType.PARTICIPANT);
        }

        Context.getCommandContext().getTaskEntityManager()
                .deleteTask(taskEntity, comment, false);

        if (taskEntity.getExecutionId() != null) {
            ExecutionEntity execution = taskEntity.getExecution();
            execution.removeTask(taskEntity);
            execution.signal(null, null);
        }

        return null;
View Full Code Here

        }
    }

    public void copyTask(DelegateTask delegateTask, String userId) {
        // 创建新任务
        TaskEntity task = TaskEntity.create(new Date());
        task.setProcessDefinitionId(delegateTask.getProcessDefinitionId());

        task.setAssigneeWithoutCascade(userId);
        // task.setParentTaskIdWithoutCascade(delegateTask.getParentTaskId());
        task.setNameWithoutCascade(delegateTask.getName());
        task.setTaskDefinitionKey(delegateTask.getTaskDefinitionKey());
        task.setExecutionId(delegateTask.getExecutionId());
        task.setPriority(delegateTask.getPriority());
        task.setProcessInstanceId(delegateTask.getProcessInstanceId());
        task.setExecutionId(delegateTask.getExecutionId());
        task.setDescriptionWithoutCascade(delegateTask.getDescription());
        task.setCategory("copy");

        Context.getCommandContext().getTaskEntityManager().insert(task);
    }
View Full Code Here

  public GetTaskFormCmd(String taskId) {
    this.taskId = taskId;
  }

  public TaskFormData execute(CommandContext commandContext) {
    TaskEntity task = Context
      .getCommandContext()
      .getTaskManager()
      .findTaskById(taskId);
    if (task == null) {
      throw new ActivitiException("No task found for taskId '" + taskId +"'");
    }
   
    if(task.getTaskDefinition() != null) {
      TaskFormHandler taskFormHandler = task.getTaskDefinition().getTaskFormHandler();
      if (taskFormHandler == null) {
        throw new ActivitiException("No taskFormHandler specified for task '" + taskId +"'");
      }
     
      return taskFormHandler.createTaskForm(task);
View Full Code Here

   
    if(taskId == null) {
      throw new ActivitiException("taskId is null");
    }
   
    TaskEntity task = Context
      .getCommandContext()
      .getTaskManager()
      .findTaskById(taskId);
   
    if (task == null) {
      throw new ActivitiException("Cannot find task with id " + taskId);
    }
   
    if (task.isSuspended()) {
      throw new ActivitiException(getSuspendedTaskException());
    }
   
    return execute(commandContext, task);
  }
View Full Code Here

TOP

Related Classes of org.activiti.engine.impl.persistence.entity.TaskEntity

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.