本文整理汇总了Java中org.activiti.engine.impl.persistence.entity.TaskEntity.setId方法的典型用法代码示例。如果您正苦于以下问题:Java TaskEntity.setId方法的具体用法?Java TaskEntity.setId怎么用?Java TaskEntity.setId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.activiti.engine.impl.persistence.entity.TaskEntity
的用法示例。
在下文中一共展示了TaskEntity.setId方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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;
}
示例2: execute
import org.activiti.engine.impl.persistence.entity.TaskEntity; //导入方法依赖的package包/类
@Override
public Task execute(CommandContext commandContext) {
Date currentTime = commandContext.getProcessEngineConfiguration().getClock().getCurrentTime();
TaskEntity task = TaskEntity.create(currentTime);
task.setId(taskId);
return task;
}
示例3: processComplete
import org.activiti.engine.impl.persistence.entity.TaskEntity; //导入方法依赖的package包/类
public void processComplete(DelegateTask delegateTask,
BpmConfNotice bpmConfNotice) {
UserConnector userConnector = ApplicationContextHelper
.getBean(UserConnector.class);
NotificationConnector notificationConnector = ApplicationContextHelper
.getBean(NotificationConnector.class);
//
Map<String, Object> data = new HashMap<String, Object>();
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));
//
data.put("task", taskEntity);
data.put("initiator", this.getInitiator(userConnector, delegateTask));
String receiver = bpmConfNotice.getReceiver();
/*
* BpmMailTemplate bpmMailTemplate = bpmConfNotice.getBpmMailTemplate(); ExpressionManager expressionManager =
* Context .getProcessEngineConfiguration().getExpressionManager();
*/
UserDTO userDto = null;
if ("任务接收人".equals(receiver)) {
userDto = userConnector.findById(delegateTask.getAssignee());
} else if ("流程发起人".equals(receiver)) {
userDto = userConnector.findById((String) delegateTask
.getVariables().get("initiator"));
} else {
HistoricProcessInstanceEntity historicProcessInstanceEntity = Context
.getCommandContext()
.getHistoricProcessInstanceEntityManager()
.findHistoricProcessInstance(
delegateTask.getProcessInstanceId());
userDto = userConnector.findById(historicProcessInstanceEntity
.getStartUserId());
}
/*
* String subject = expressionManager .createExpression(bpmMailTemplate.getSubject())
* .getValue(taskEntity).toString();
*
* String content = expressionManager .createExpression(bpmMailTemplate.getContent())
* .getValue(taskEntity).toString(); this.sendMail(userDto, subject, content); this.sendSiteMessage(userDto,
* subject, content);
*/
NotificationDTO notificationDto = new NotificationDTO();
notificationDto.setReceiver(userDto.getId());
notificationDto.setReceiverType("userid");
notificationDto.setTypes(Arrays.asList(bpmConfNotice
.getNotificationType().split(",")));
notificationDto.setData(data);
notificationDto.setTemplate(bpmConfNotice.getTemplateCode());
notificationConnector.send(notificationDto, delegateTask.getTenantId());
}
示例4: processArrival
import org.activiti.engine.impl.persistence.entity.TaskEntity; //导入方法依赖的package包/类
public void processArrival(DelegateTask delegateTask,
BpmConfNotice bpmConfNotice) {
UserConnector userConnector = ApplicationContextHelper
.getBean(UserConnector.class);
NotificationConnector notificationConnector = ApplicationContextHelper
.getBean(NotificationConnector.class);
//
Map<String, Object> data = new HashMap<String, Object>();
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));
logger.debug("initiator : {}", delegateTask.getVariable("initator"));
logger.debug("variables : {}", delegateTask.getVariables());
//
data.put("task", taskEntity);
data.put("initiator", this.getInitiator(userConnector, delegateTask));
String receiver = bpmConfNotice.getReceiver();
/*
* BpmMailTemplate bpmMailTemplate = bpmConfNotice.getBpmMailTemplate(); ExpressionManager expressionManager =
* Context .getProcessEngineConfiguration().getExpressionManager();
*/
UserDTO userDto = null;
/*
* String subject = expressionManager .createExpression(bpmMailTemplate.getSubject())
* .getValue(taskEntity).toString();
*
* String content = expressionManager .createExpression(bpmMailTemplate.getContent())
* .getValue(taskEntity).toString();
*/
if ("任务接收人".equals(receiver)) {
userDto = userConnector.findById(delegateTask.getAssignee());
} else if ("流程发起人".equals(receiver)) {
userDto = userConnector.findById((String) delegateTask
.getVariables().get("initiator"));
} else {
HistoricProcessInstanceEntity historicProcessInstanceEntity = Context
.getCommandContext()
.getHistoricProcessInstanceEntityManager()
.findHistoricProcessInstance(
delegateTask.getProcessInstanceId());
userDto = userConnector.findById(historicProcessInstanceEntity
.getStartUserId());
}
// this.sendMail(userDto, subject, content);
// this.sendSiteMessage(userDto, subject, content);
NotificationDTO notificationDto = new NotificationDTO();
notificationDto.setReceiver(userDto.getId());
notificationDto.setReceiverType("userid");
notificationDto.setTypes(Arrays.asList(bpmConfNotice
.getNotificationType().split(",")));
notificationDto.setData(data);
notificationDto.setTemplate(bpmConfNotice.getTemplateCode());
notificationConnector.send(notificationDto, delegateTask.getTenantId());
}
示例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.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));
}
示例6: newTask
import org.activiti.engine.impl.persistence.entity.TaskEntity; //导入方法依赖的package包/类
public Task newTask(String taskId) {
TaskEntity task = TaskEntity.create();
task.setId(taskId);
return task;
}