Beispiel #1
0
 /** 这个结束并不会去推动令牌向下。例如用在退回的时候。 */
 public void end(TaskCommand taskCommand, String taskComment) {
   if (this.isSuspended()) {
     throw ExceptionUtil.getException("10303001");
   }
   end();
   setTaskComment(taskComment);
   if (taskCommand != null
       && taskCommand.getTaskCommandType() != null
       && !taskCommand.getTaskCommandType().equals("")) {
     String taskCommandType = taskCommand.getTaskCommandType();
     String taskCommandName = taskCommand.getName();
     // 设置流程自动结束信息 autoEnd
     this.setCommandId(taskCommand.getId());
     this.setCommandType(taskCommandType);
     if (taskCommandName == null) {
       TaskCommandDefinition taskCommandDef =
           Context.getProcessEngineConfiguration().getTaskCommandDefinition(taskCommandType);
       if (taskCommandDef != null) {
         this.setCommandMessage(taskCommandDef.getName());
       }
     } else {
       this.setCommandMessage(taskCommandName);
     }
   } else {
     this.setCommandId(TaskCommandSystemType.AUTOEND);
     this.setCommandType(TaskCommandSystemType.AUTOEND);
     TaskCommandDefinition taskCommandDef =
         Context.getProcessEngineConfiguration()
             .getTaskCommandDefinition(TaskCommandSystemType.AUTOEND);
     if (taskCommandDef != null) {
       this.setCommandMessage(taskCommandDef.getName());
     }
   }
 }
Beispiel #2
0
  protected void ensureProcessDefinitionInitialized() {

    if (processDefinition == null && processDefinitionId != null) {
      ProcessDefinitionEntity processDefinition =
          Context.getProcessEngineConfiguration()
              .getDeploymentManager()
              .findDeployedProcessDefinitionById(processDefinitionId);
      setProcessDefinition(processDefinition);
    }
  }