本文整理汇总了Java中org.activiti.engine.impl.persistence.entity.TaskEntity.setOwner方法的典型用法代码示例。如果您正苦于以下问题:Java TaskEntity.setOwner方法的具体用法?Java TaskEntity.setOwner怎么用?Java TaskEntity.setOwner使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.activiti.engine.impl.persistence.entity.TaskEntity
的用法示例。
在下文中一共展示了TaskEntity.setOwner方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: execute
import org.activiti.engine.impl.persistence.entity.TaskEntity; //导入方法依赖的package包/类
@Override
protected Void execute(CommandContext commandContext, TaskEntity task) {
if (IdentityLinkType.ASSIGNEE.equals(type)) {
task.setAssignee(null, true, true);
} else if (IdentityLinkType.OWNER.equals(type)) {
task.setOwner(null, true);
} else {
task.deleteIdentityLink(userId, groupId, type);
}
commandContext.getHistoryManager()
.createIdentityLinkComment(taskId, userId, groupId, type, false);
return null;
}
示例2: execute
import org.activiti.engine.impl.persistence.entity.TaskEntity; //导入方法依赖的package包/类
protected Void execute(CommandContext commandContext, TaskEntity task) {
boolean assignedToNoOne = false;
if (IdentityLinkType.ASSIGNEE.equals(type)) {
task.setAssignee(userId);
assignedToNoOne = userId == null;
} else if (IdentityLinkType.OWNER.equals(type)) {
task.setOwner(userId);
} else {
task.addIdentityLink(userId, groupId, type);
}
if (assignedToNoOne) {
// ACT-1317: Special handling when assignee is set to NULL, a CommentEntity notifying of assignee-delete should be created
commandContext.getHistoryManager().createIdentityLinkComment(taskId, userId, groupId, type, false, true);
} else {
commandContext.getHistoryManager().createIdentityLinkComment(taskId, userId, groupId, type, true);
}
return null;
}
示例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;
}
示例4: execute
import org.activiti.engine.impl.persistence.entity.TaskEntity; //导入方法依赖的package包/类
@Override
protected Void execute(CommandContext commandContext, TaskEntity task) {
boolean assignedToNoOne = false;
if (IdentityLinkType.ASSIGNEE.equals(identityType)) {
task.setAssignee(identityId, true, true);
assignedToNoOne = identityId == null;
} else if (IdentityLinkType.OWNER.equals(identityType)) {
task.setOwner(identityId, true);
} else if (IDENTITY_USER == identityIdType) {
task.addUserIdentityLink(identityId, identityType);
} else if (IDENTITY_GROUP == identityIdType) {
task.addGroupIdentityLink(identityId, identityType);
}
boolean forceNullUserId = false;
if (assignedToNoOne) {
// ACT-1317: Special handling when assignee is set to NULL, a
// CommentEntity notifying of assignee-delete should be created
forceNullUserId = true;
}
if (IDENTITY_USER == identityIdType) {
commandContext.getHistoryManager().createUserIdentityLinkComment(taskId, identityId, identityType, true, forceNullUserId);
} else {
commandContext.getHistoryManager().createGroupIdentityLinkComment(taskId, identityId, identityType, true);
}
return null;
}
示例5: execute
import org.activiti.engine.impl.persistence.entity.TaskEntity; //导入方法依赖的package包/类
public Void execute(CommandContext commandContext) {
TaskEntity task = Context
.getCommandContext()
.getTaskManager()
.findTaskById(taskId);
if (task == null) {
throw new ActivitiException("Cannot find task with id " + taskId);
}
if (IdentityLinkType.ASSIGNEE.equals(type)) {
task.setAssignee(userId);
} else if (IdentityLinkType.OWNER.equals(type)) {
task.setOwner(userId);
} else {
task.addIdentityLink(userId, groupId, type);
}
CommentManager commentManager = commandContext.getCommentManager();
if (commentManager.isHistoryEnabled()) {
String authenticatedUserId = Authentication.getAuthenticatedUserId();
CommentEntity comment = new CommentEntity();
comment.setUserId(authenticatedUserId);
comment.setType(CommentEntity.TYPE_EVENT);
comment.setTime(ClockUtil.getCurrentTime());
comment.setTaskId(taskId);
if (userId!=null) {
comment.setAction(Event.ACTION_ADD_USER_LINK);
comment.setMessage(new String[]{userId, type});
} else {
comment.setAction(Event.ACTION_ADD_GROUP_LINK);
comment.setMessage(new String[]{groupId, type});
}
commentManager.insert(comment);
}
return null;
}
示例6: execute
import org.activiti.engine.impl.persistence.entity.TaskEntity; //导入方法依赖的package包/类
protected Void execute(CommandContext commandContext, TaskEntity task) {
if (IdentityLinkType.ASSIGNEE.equals(type)) {
task.setAssignee(null);
} else if (IdentityLinkType.OWNER.equals(type)) {
task.setOwner(null);
} else {
task.deleteIdentityLink(userId, groupId, type);
}
commandContext.getHistoryManager()
.createIdentityLinkComment(taskId, userId, groupId, type, false);
return null;
}