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


Java TaskEntity.setName方法代码示例

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


在下文中一共展示了TaskEntity.setName方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:12,代码来源:TestFlowableEntityEventTaskListener.java

示例2: execute

import org.activiti.engine.impl.persistence.entity.TaskEntity; //导入方法依赖的package包/类
@Override
public Task execute(CommandContext commandContext) {
    TaskEntityManager taskEntityManager = commandContext.getTaskEntityManager();
    TaskEntity task = taskEntityManager.findTaskById(taskId);
    task.setName(taskName);
    task.update();
    return task;
}
 
开发者ID:shawn-gogh,项目名称:myjavacode,代码行数:9,代码来源:ModifyTaskNameCmd.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

示例4: 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);
    }
  }
  
  handleAssignments(task, execution);
 
  // All properties set, now firing 'create' event
  task.fireEvent(TaskListener.EVENTNAME_CREATE);
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:32,代码来源:UserTaskActivityBehavior.java

示例5: 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());
}
 
开发者ID:zhaojunfei,项目名称:lemon,代码行数:62,代码来源:CompleteNotice.java

示例6: 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());
}
 
开发者ID:zhaojunfei,项目名称:lemon,代码行数:65,代码来源:ArrivalNotice.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包/类
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.setName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。