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


Java TaskEntity.getId方法代码示例

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


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

示例1: execute

import org.activiti.engine.impl.persistence.entity.TaskEntity; //导入方法依赖的package包/类
@Override
protected Void execute(CommandContext commandContext, TaskEntity task) {

    if (userId != null) {
        if (task.getAssignee() != null) {
            if (!task.getAssignee().equals(userId)) {
                // When the task is already claimed by another user, throw exception. Otherwise, ignore
                // this, post-conditions of method already met.
                throw new ActivitiTaskAlreadyClaimedException(task.getId(), task.getAssignee());
            }
        } else {
            task.setAssignee(userId, true, true);
        }
    } else {
        // Task should be assigned to no one
        task.setAssignee(null, true, true);
    }

    // Add claim time
    commandContext.getHistoryManager().recordTaskClaim(taskId);

    return null;
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:24,代码来源:ClaimTaskCmd.java

示例2: execute

import org.activiti.engine.impl.persistence.entity.TaskEntity; //导入方法依赖的package包/类
protected Void execute(CommandContext commandContext, TaskEntity task) {

    if(userId != null) {
      if (task.getAssignee() != null) {
        if(!task.getAssignee().equals(userId)) {
          // When the task is already claimed by another user, throw exception. Otherwise, ignore
          // this, post-conditions of method already met.
          throw new ActivitiTaskAlreadyClaimedException(task.getId(), task.getAssignee());
        }
      } else {
        task.setAssignee(userId);
      }      
    } else {
      // Task should be assigned to no one
      task.setAssignee(null);
    }
    
    // Add claim time
    commandContext.getHistoryManager().recordTaskClaim( taskId);

    return null;
  }
 
开发者ID:springvelocity,项目名称:xbpm5,代码行数:23,代码来源:ClaimTaskCmd.java

示例3: createTask

import org.activiti.engine.impl.persistence.entity.TaskEntity; //导入方法依赖的package包/类
public void createTask(CommandContext commandContext, DbSqlSession dbSqlSession, MailTransformer mailTransformer) throws MessagingException {
  // distill the task description from the mail body content (without the html tags)
  String taskDescription = mailTransformer.getHtml();
  taskDescription = taskDescription.replaceAll("\\<.*?\\>", "");
  taskDescription = taskDescription.replaceAll("\\s", " ");
  taskDescription = taskDescription.trim();
  if (taskDescription.length()>120) {
    taskDescription = taskDescription.substring(0, 117)+"...";
  }

  // create and insert the task
  TaskEntity task = new TaskEntity();
  task.setAssignee(userId);
  task.setName(mailTransformer.getMessage().getSubject());
  task.setDescription(taskDescription);
  dbSqlSession.insert(task);
  String taskId = task.getId();
  
  // add identity links for all the recipients
  for (String recipientEmailAddress: mailTransformer.getRecipients()) {
    User recipient = new UserQueryImpl(commandContext)
      .userEmail(recipientEmailAddress)
      .singleResult();
    if (recipient!=null) {
      task.addUserIdentityLink(recipient.getId(), "Recipient");
    }
  }
  
  // attach the mail and other attachments to the task
  List<AttachmentEntity> attachments = mailTransformer.getAttachments();
  for (AttachmentEntity attachment: attachments) {
    // insert the bytes as content
    ByteArrayEntity content = attachment.getContent();
    dbSqlSession.insert(content);
    // insert the attachment
    attachment.setContentId(content.getId());
    attachment.setTaskId(taskId);
    dbSqlSession.insert(attachment);
  }
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:41,代码来源:MailScanCmd.java


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