Examples of TaskEntity


Examples of io.iron.ironworker.client.entities.TaskEntity

import io.iron.ironworker.client.APIException;

public class Enqueue {
        public static void main(String[] args) throws APIException{
                Client client = new Client("INSERT TOKEN HERE", "INSERT PROJECT ID HRE");
                TaskEntity t = client.createTask("JavaWorker101", Params.add("query", "iron"));
                System.out.println(t.getId());
        }
View Full Code Here

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

      throw new ApplicationException("任务["+task.getName()+"]已是会签任务!");
   
    //taskService.
   
    for( String user:userIds ){
      TaskEntity newTask = (TaskEntity) taskService.newTask(); //TODO 更改ID规则
     
      newTask.setAssignee(user)
      newTask.setName( task.getName() + "-[会签]")
      newTask.setProcessDefinitionId(task.getProcessDefinitionId())
      newTask.setProcessInstanceId(task.getProcessInstanceId() )
      newTask.setParentTaskId(taskId)
      newTask.setDescription( task.getName() + "-添加会签人["+user+"]")
            taskService.saveTask(newTask);
    }
  }
View Full Code Here

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

        throw new ApplicationException("不能添加自己["+user+"]为会签人");
       
      if( subTaskMap.get(user) != null )
        throw new ApplicationException("任务已添加会签人["+user+"]");
     
      TaskEntity subTask = (TaskEntity)taskService.newTask();
      subTask.setParentTaskId(taskId); //上级Task
      subTask.setName( task.getName() + "-["+user+"]会签");
      subTask.setAssignee( user ); //会签用户
      subTask.setProcessDefinitionId( task.getProcessDefinitionId() );
      subTask.setProcessInstanceId( task.getProcessInstanceId() );
      subTask.setDescription("会签");
     
      taskService.saveTask(subTask);
     
      message.append((i==0?"":",") +user);
      ++i;
View Full Code Here

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

        return 0;
    }

    public boolean isSameBranch(
            HistoricTaskInstanceEntity historicTaskInstanceEntity) {
        TaskEntity taskEntity = Context.getCommandContext()
                .getTaskEntityManager().findTaskById(taskId);

        return taskEntity.getExecutionId().equals(
                historicTaskInstanceEntity.getExecutionId());
    }
View Full Code Here

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

        return taskEntity.getExecutionId().equals(
                historicTaskInstanceEntity.getExecutionId());
    }

    public String findNearestUserTask() {
        TaskEntity taskEntity = Context.getCommandContext()
                .getTaskEntityManager().findTaskById(taskId);

        if (taskEntity == null) {
            logger.debug("cannot find task : {}", taskId);

            return null;
        }

        Graph graph = new ActivitiHistoryGraphBuilder(
                taskEntity.getProcessInstanceId()).build();
        JdbcTemplate jdbcTemplate = ApplicationContextHelper
                .getBean(JdbcTemplate.class);
        String historicActivityInstanceId = jdbcTemplate.queryForObject(
                "select id_ from ACT_HI_ACTINST where task_id_=?",
                String.class, taskId);
View Full Code Here

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

         * 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.setExecutionId(historicTaskInstanceEntity.getExecutionId());
        task.setDescriptionWithoutCascade(historicTaskInstanceEntity
                .getDescription());

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

        // 把流程指向任务对应的节点
View Full Code Here

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

    /**
     * 删除未完成任务.
     */
    public void deleteActiveTask() {
        TaskEntity taskEntity = Context.getCommandContext()
                .getTaskEntityManager().findTaskById(taskId);
        Context.getCommandContext().getTaskEntityManager()
                .deleteTask(taskEntity, "回退", false);

        JdbcTemplate jdbcTemplate = ApplicationContextHelper
View Full Code Here

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

        this.taskId = taskId;
        this.userId = userId;
    }

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

        this.createSubTask(parentTask, parentTask.getAssignee());
        this.createSubTask(parentTask, userId);
        parentTask.setAssigneeWithoutCascade(null);

        return null;
    }
View Full Code Here

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

        return null;
    }

    public void createSubTask(TaskEntity parentTask, String assignee) {
        TaskEntity task = TaskEntity.create(new Date());
        task.setProcessDefinitionId(parentTask.getProcessDefinitionId());
        // task.setId(historicTaskInstanceEntity.getId());
        task.setAssigneeWithoutCascade(assignee);
        task.setParentTaskIdWithoutCascade(parentTask.getId());
        task.setNameWithoutCascade(parentTask.getName());
        task.setTaskDefinitionKey(parentTask.getTaskDefinitionKey());
        task.setExecutionId(parentTask.getExecutionId());
        task.setPriority(parentTask.getPriority());
        task.setProcessInstanceId(parentTask.getProcessInstanceId());
        task.setDescriptionWithoutCascade(parentTask.getDescription());
        task.setCategory("subtask");

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

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

        this.taskId = taskId;
        this.comment = comment;
    }

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

        // 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);
        }
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.