}
}
TokenEntity token = executionContext.getToken();
TaskInstanceEntity newTask = TaskInstanceEntity.create();
newTask.setId(GuidUtil.CreateGuid());
newTask.setCreateTime(new Date());
newTask.setNodeId(this.getId());
if (skipAssigneeString != null && !skipAssigneeString.equals("")) {
newTask.setAssignee(skipAssigneeString);
}
newTask.setDraft(false);
Date date = new Date();
Calendar cal = Calendar.getInstance();
cal.setTime(date);
cal.add(Calendar.MILLISECOND, 1);
date = cal.getTime();
newTask.setEndTime(date);
newTask.setPriority(50);
ProcessDefinitionBehavior processDefinition = token.getProcessInstance().getProcessDefinition();
String processDefinitionId = processDefinition.getProcessDefinitionId();
newTask.setProcessDefinitionId(processDefinitionId);
newTask.setProcessDefinitionKey(processDefinition.getProcessDefinitionKey());
newTask.setName(this.getName());
newTask.setNodeName(this.getName());
newTask.setProcessInstanceId(token.getProcessInstance().getId());
newTask.setTokenId(token.getId());
newTask.setProcessDefinitionName(processDefinition.getName());
newTask.setTaskInstanceType(TaskInstanceType.FIXBPMTASK);
String bizKey = token.getProcessInstance().getBizKey();
newTask.setBizKey(bizKey);
newTask.setCommandId(TaskCommandType.SKIPNODE);
newTask.setCommandType(TaskCommandType.SKIPNODE);
TaskCommandDef taskCommandDef = Context.getProcessEngineConfiguration().getTaskCommandDefMap().get("skipNode");
if (taskCommandDef.getName() != null) {
newTask.setCommandMessage(taskCommandDef.getName());
}
if (skipCommentString != null && !skipCommentString.equals("")) {
newTask.setTaskComment(skipCommentString);
}
Context.getCommandContext().getTaskManager().saveTaskInstanceEntity(newTask);
}