当前位置: 首页>>代码示例>>Java>>正文


Java TaskEntity.setPriority方法代码示例

本文整理汇总了Java中org.activiti.engine.impl.persistence.entity.TaskEntity.setPriority方法的典型用法代码示例。如果您正苦于以下问题:Java TaskEntity.setPriority方法的具体用法?Java TaskEntity.setPriority怎么用?Java TaskEntity.setPriority使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.activiti.engine.impl.persistence.entity.TaskEntity的用法示例。


在下文中一共展示了TaskEntity.setPriority方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createSubTask

import org.activiti.engine.impl.persistence.entity.TaskEntity; //导入方法依赖的package包/类
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);
}
 
开发者ID:zhaojunfei,项目名称:lemon,代码行数:17,代码来源:ChangeSubTaskCmd.java

示例2: execute

import org.activiti.engine.impl.persistence.entity.TaskEntity; //导入方法依赖的package包/类
public Void execute(CommandContext commandContext) {
  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);
  }
  
  task.setPriority(priority);
  
  return null;
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:19,代码来源:SetTaskPriorityCmd.java

示例3: copy

import org.activiti.engine.impl.persistence.entity.TaskEntity; //导入方法依赖的package包/类
private Task copy(Task aTask) {
    TaskEntity ent = TaskEntity.create(aTask.getCreateTime());
    ent.setId(aTask.getId());
    ent.setName(aTask.getName());
    ent.setDescription(aTask.getDescription());
    ent.setOwner(aTask.getOwner());
    ent.setDueDateWithoutCascade(aTask.getDueDate());
    ent.setAssignee(aTask.getAssignee());
    ent.setPriority(aTask.getPriority());
    return ent;
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:12,代码来源:TestFlowableEntityEventTaskListener.java

示例4: processHistoryTask

import org.activiti.engine.impl.persistence.entity.TaskEntity; //导入方法依赖的package包/类
public void processHistoryTask(
        HistoricTaskInstanceEntity historicTaskInstanceEntity,
        HistoricActivityInstanceEntity historicActivityInstanceEntity) {
    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());
    task.setTenantId(historicTaskInstanceEntity.getTenantId());

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

    try {
        HumanTaskConnector humanTaskConnector = ApplicationContextHelper
                .getBean(HumanTaskConnector.class);
        // humantask
        humanTaskConnector
                .removeHumanTaskByTaskId(historicTaskInstanceEntity.getId());
        this.createHumanTask(task, historicTaskInstanceEntity);
    } catch (Exception ex) {
        logger.error(ex.getMessage(), ex);
    }

    ExecutionEntity executionEntity = Context.getCommandContext()
            .getExecutionEntityManager()
            .findExecutionById(historicTaskInstanceEntity.getExecutionId());
    executionEntity
            .setActivity(getActivity(historicActivityInstanceEntity));
}
 
开发者ID:zhaojunfei,项目名称:lemon,代码行数:46,代码来源:WithdrawTaskCmd.java

示例5: processHistoryTask

import org.activiti.engine.impl.persistence.entity.TaskEntity; //导入方法依赖的package包/类
/**
 * 根据任务历史,创建待办任务.
 */
public void processHistoryTask(
        HistoricTaskInstanceEntity historicTaskInstanceEntity,
        HistoricActivityInstanceEntity historicActivityInstanceEntity) {
    /*
     * 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.setAssigneeWithoutCascade(this.userId);
    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());
    task.setTenantId(historicTaskInstanceEntity.getTenantId());

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

    // 把流程指向任务对应的节点
    ExecutionEntity executionEntity = Context.getCommandContext()
            .getExecutionEntityManager()
            .findExecutionById(historicTaskInstanceEntity.getExecutionId());
    executionEntity
            .setActivity(getActivity(historicActivityInstanceEntity));

    // 创建HistoricActivityInstance
    Context.getCommandContext().getHistoryManager()
            .recordActivityStart(executionEntity);

    // 创建HistoricTaskInstance
    Context.getCommandContext().getHistoryManager()
            .recordTaskCreated(task, executionEntity);
    Context.getCommandContext().getHistoryManager().recordTaskId(task);
    // 更新ACT_HI_ACTIVITY里的assignee字段
    Context.getCommandContext().getHistoryManager()
            .recordTaskAssignment(task);

    try {
        // humanTask
        this.createHumanTask(task, historicTaskInstanceEntity);
    } catch (Exception ex) {
        logger.error(ex.getMessage(), ex);
    }
}
 
开发者ID:zhaojunfei,项目名称:lemon,代码行数:61,代码来源:RollbackCmd.java

示例6: execute

import org.activiti.engine.impl.persistence.entity.TaskEntity; //导入方法依赖的package包/类
@Override
protected Void execute(CommandContext commandContext, TaskEntity task) {
    task.setPriority(priority, true);
    return null;
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:6,代码来源:SetTaskPriorityCmd.java

示例7: execute

import org.activiti.engine.impl.persistence.entity.TaskEntity; //导入方法依赖的package包/类
public void execute(ActivityExecution execution) throws Exception {
  TaskEntity task = TaskEntity.createAndInsert(execution);
  task.setExecution(execution);
  task.setTaskDefinition(taskDefinition);

  if (taskDefinition.getNameExpression() != null) {
    String name = (String) taskDefinition.getNameExpression().getValue(execution);
    task.setName(name);
  }

  if (taskDefinition.getDescriptionExpression() != null) {
    String description = (String) taskDefinition.getDescriptionExpression().getValue(execution);
    task.setDescription(description);
  }
  
  if(taskDefinition.getDueDateExpression() != null) {
    Object dueDate = taskDefinition.getDueDateExpression().getValue(execution);
    if(dueDate != null) {
      if(!(dueDate instanceof Date)) {
        throw new ActivitiException("Due date expression does not resolve to a Date: " + 
                taskDefinition.getDueDateExpression().getExpressionText());
      }
      task.setDueDate((Date) dueDate);
    }
  }

  if (taskDefinition.getPriorityExpression() != null) {
    final Object priority = taskDefinition.getPriorityExpression().getValue(execution);
    if (priority != null) {
      if (priority instanceof String) {
        try {
          task.setPriority(Integer.valueOf((String) priority));
        } catch (NumberFormatException e) {
          throw new ActivitiException("Priority does not resolve to a number: " + priority, e);
        }
      } else if (priority instanceof Number) {
        task.setPriority(((Number) priority).intValue());
      } else {
        throw new ActivitiException("Priority expression does not resolve to a number: " + 
                taskDefinition.getPriorityExpression().getExpressionText());
      }
    }
  }
  
  handleAssignments(task, execution);
 
  // All properties set, now firing 'create' event
  task.fireEvent(TaskListener.EVENTNAME_CREATE);
}
 
开发者ID:iotsap,项目名称:FiWare-Template-Handler,代码行数:50,代码来源:UserTaskActivityBehavior.java

示例8: execute

import org.activiti.engine.impl.persistence.entity.TaskEntity; //导入方法依赖的package包/类
protected Void execute(CommandContext commandContext, TaskEntity task) {
  task.setPriority(priority);
  return null;
}
 
开发者ID:springvelocity,项目名称:xbpm5,代码行数:5,代码来源:SetTaskPriorityCmd.java

示例9: execute

import org.activiti.engine.impl.persistence.entity.TaskEntity; //导入方法依赖的package包/类
public void execute(ActivityExecution execution) throws Exception {
  TaskEntity task = TaskEntity.createAndInsert(execution);
  task.setExecution(execution);
  task.setTaskDefinition(taskDefinition);

  if (taskDefinition.getNameExpression() != null) {
    String name = (String) taskDefinition.getNameExpression().getValue(execution);
    task.setName(name);
  }

  if (taskDefinition.getDescriptionExpression() != null) {
    String description = (String) taskDefinition.getDescriptionExpression().getValue(execution);
    task.setDescription(description);
  }
  
  if(taskDefinition.getDueDateExpression() != null) {
    Object dueDate = taskDefinition.getDueDateExpression().getValue(execution);
    if(dueDate != null) {
      if (dueDate instanceof Date) {
        task.setDueDate((Date) dueDate);
      } else if (dueDate instanceof String) {
        task.setDueDate(new DueDateBusinessCalendar().resolveDuedate((String) dueDate)); 
      } else {
        throw new ActivitiIllegalArgumentException("Due date expression does not resolve to a Date or Date string: " + 
            taskDefinition.getDueDateExpression().getExpressionText());
      }
    }
  }

  if (taskDefinition.getPriorityExpression() != null) {
    final Object priority = taskDefinition.getPriorityExpression().getValue(execution);
    if (priority != null) {
      if (priority instanceof String) {
        try {
          task.setPriority(Integer.valueOf((String) priority));
        } catch (NumberFormatException e) {
          throw new ActivitiIllegalArgumentException("Priority does not resolve to a number: " + priority, e);
        }
      } else if (priority instanceof Number) {
        task.setPriority(((Number) priority).intValue());
      } else {
        throw new ActivitiIllegalArgumentException("Priority expression does not resolve to a number: " + 
                taskDefinition.getPriorityExpression().getExpressionText());
      }
    }
  }
  
  handleAssignments(task, execution);
 
  // All properties set, now firing 'create' event
  task.fireEvent(TaskListener.EVENTNAME_CREATE);
}
 
开发者ID:springvelocity,项目名称:xbpm5,代码行数:53,代码来源:UserTaskActivityBehavior.java


注:本文中的org.activiti.engine.impl.persistence.entity.TaskEntity.setPriority方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。