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


Java TaskEntity.setOwner方法代码示例

本文整理汇总了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;
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:17,代码来源:DeleteIdentityLinkCmd.java

示例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;  
  }
 
开发者ID:springvelocity,项目名称:xbpm5,代码行数:22,代码来源:AddIdentityLinkCmd.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: 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;
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:32,代码来源:AddIdentityLinkCmd.java

示例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;  
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:39,代码来源:AddIdentityLinkCmd.java

示例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;  
  }
 
开发者ID:springvelocity,项目名称:xbpm5,代码行数:16,代码来源:DeleteIdentityLinkCmd.java


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