本文整理了Java中com.netflix.conductor.common.metadata.tasks.Task.setWorkflowType()
方法的一些代码示例,展示了Task.setWorkflowType()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Task.setWorkflowType()
方法的具体详情如下:
包路径:com.netflix.conductor.common.metadata.tasks.Task
类名称:Task
方法名:setWorkflowType
暂无
代码示例来源:origin: Netflix/conductor
@Override
public List<Task> getMappedTasks(TaskMapperContext taskMapperContext) {
logger.debug("TaskMapperContext {} in SubWorkflowTaskMapper", taskMapperContext);
WorkflowTask taskToSchedule = taskMapperContext.getTaskToSchedule();
Workflow workflowInstance = taskMapperContext.getWorkflowInstance();
String taskId = taskMapperContext.getTaskId();
//Check if the are sub workflow parameters, if not throw an exception, cannot initiate a sub-workflow without workflow params
SubWorkflowParams subWorkflowParams = getSubWorkflowParams(taskToSchedule);
Map<String, Object> resolvedParams = getSubWorkflowInputParameters(workflowInstance, subWorkflowParams);
String subWorkflowName = resolvedParams.get("name").toString();
Integer subWorkflowVersion = getSubWorkflowVersion(resolvedParams, subWorkflowName);
Task subWorkflowTask = new Task();
subWorkflowTask.setTaskType(SubWorkflow.NAME);
subWorkflowTask.setTaskDefName(taskToSchedule.getName());
subWorkflowTask.setReferenceTaskName(taskToSchedule.getTaskReferenceName());
subWorkflowTask.setWorkflowInstanceId(workflowInstance.getWorkflowId());
subWorkflowTask.setWorkflowType(workflowInstance.getWorkflowName());
subWorkflowTask.setCorrelationId(workflowInstance.getCorrelationId());
subWorkflowTask.setScheduledTime(System.currentTimeMillis());
subWorkflowTask.getInputData().put("subWorkflowName", subWorkflowName);
subWorkflowTask.getInputData().put("subWorkflowVersion", subWorkflowVersion);
subWorkflowTask.getInputData().put("workflowInput", taskMapperContext.getTaskInput());
subWorkflowTask.setTaskId(taskId);
subWorkflowTask.setStatus(Task.Status.SCHEDULED);
subWorkflowTask.setWorkflowTask(taskToSchedule);
logger.debug("SubWorkflowTask {} created to be Scheduled", subWorkflowTask);
return Collections.singletonList(subWorkflowTask);
}
代码示例来源:origin: Netflix/conductor
decisionTask.setReferenceTaskName(taskToSchedule.getTaskReferenceName());
decisionTask.setWorkflowInstanceId(workflowInstance.getWorkflowId());
decisionTask.setWorkflowType(workflowInstance.getWorkflowName());
decisionTask.setCorrelationId(workflowInstance.getCorrelationId());
decisionTask.setScheduledTime(System.currentTimeMillis());
代码示例来源:origin: Netflix/conductor
eventTask.setReferenceTaskName(taskToSchedule.getTaskReferenceName());
eventTask.setWorkflowInstanceId(workflowInstance.getWorkflowId());
eventTask.setWorkflowType(workflowInstance.getWorkflowName());
eventTask.setCorrelationId(workflowInstance.getCorrelationId());
eventTask.setScheduledTime(System.currentTimeMillis());
代码示例来源:origin: Netflix/conductor
joinTask.setWorkflowInstanceId(workflowInstance.getWorkflowId());
joinTask.setCorrelationId(workflowInstance.getCorrelationId());
joinTask.setWorkflowType(workflowInstance.getWorkflowName());
joinTask.setScheduledTime(System.currentTimeMillis());
joinTask.setInputData(joinInput);
代码示例来源:origin: Netflix/conductor
userDefinedTask.setReferenceTaskName(taskToSchedule.getTaskReferenceName());
userDefinedTask.setWorkflowInstanceId(workflowInstance.getWorkflowId());
userDefinedTask.setWorkflowType(workflowInstance.getWorkflowName());
userDefinedTask.setCorrelationId(workflowInstance.getCorrelationId());
userDefinedTask.setScheduledTime(System.currentTimeMillis());
代码示例来源:origin: Netflix/conductor
/**
* This method creates a JOIN task that is used in the {@link this#getMappedTasks(TaskMapperContext)}
* at the end to add a join task to be scheduled after all the fork tasks
*
* @param workflowInstance: A instance of the {@link Workflow} which represents the workflow being executed.
* @param joinWorkflowTask: A instance of {@link WorkflowTask} which is of type {@link TaskType#JOIN}
* @param joinInput: The input which is set in the {@link Task#setInputData(Map)}
* @return a new instance of {@link Task} representing a {@link SystemTaskType#JOIN}
*/
@VisibleForTesting
Task createJoinTask(Workflow workflowInstance, WorkflowTask joinWorkflowTask, HashMap<String, Object> joinInput) {
Task joinTask = new Task();
joinTask.setTaskType(SystemTaskType.JOIN.name());
joinTask.setTaskDefName(SystemTaskType.JOIN.name());
joinTask.setReferenceTaskName(joinWorkflowTask.getTaskReferenceName());
joinTask.setWorkflowInstanceId(workflowInstance.getWorkflowId());
joinTask.setWorkflowType(workflowInstance.getWorkflowName());
joinTask.setCorrelationId(workflowInstance.getCorrelationId());
joinTask.setScheduledTime(System.currentTimeMillis());
joinTask.setInputData(joinInput);
joinTask.setTaskId(IDGenerator.generate());
joinTask.setStatus(Task.Status.IN_PROGRESS);
joinTask.setWorkflowTask(joinWorkflowTask);
return joinTask;
}
代码示例来源:origin: Netflix/conductor
forkTask.setReferenceTaskName(taskToSchedule.getTaskReferenceName());
forkTask.setWorkflowInstanceId(workflowInstance.getWorkflowId());
forkTask.setWorkflowType(workflowInstance.getWorkflowName());
forkTask.setCorrelationId(workflowInstance.getCorrelationId());
forkTask.setScheduledTime(System.currentTimeMillis());
代码示例来源:origin: Netflix/conductor
@Override
public List<Task> getMappedTasks(TaskMapperContext taskMapperContext) {
logger.debug("TaskMapperContext {} in WaitTaskMapper", taskMapperContext);
WorkflowTask taskToSchedule = taskMapperContext.getTaskToSchedule();
Workflow workflowInstance = taskMapperContext.getWorkflowInstance();
String taskId = taskMapperContext.getTaskId();
Map<String, Object> waitTaskInput = parametersUtils.getTaskInputV2(taskMapperContext.getTaskToSchedule().getInputParameters(),
workflowInstance, taskId, null);
Task waitTask = new Task();
waitTask.setTaskType(Wait.NAME);
waitTask.setTaskDefName(taskMapperContext.getTaskToSchedule().getName());
waitTask.setReferenceTaskName(taskMapperContext.getTaskToSchedule().getTaskReferenceName());
waitTask.setWorkflowInstanceId(workflowInstance.getWorkflowId());
waitTask.setWorkflowType(workflowInstance.getWorkflowName());
waitTask.setCorrelationId(workflowInstance.getCorrelationId());
waitTask.setScheduledTime(System.currentTimeMillis());
waitTask.setInputData(waitTaskInput);
waitTask.setTaskId(taskId);
waitTask.setStatus(Task.Status.IN_PROGRESS);
waitTask.setWorkflowTask(taskToSchedule);
return Collections.singletonList(waitTask);
}
}
代码示例来源:origin: Netflix/conductor
httpTask.setReferenceTaskName(taskToSchedule.getTaskReferenceName());
httpTask.setWorkflowInstanceId(workflowInstance.getWorkflowId());
httpTask.setWorkflowType(workflowInstance.getWorkflowName());
httpTask.setCorrelationId(workflowInstance.getCorrelationId());
httpTask.setScheduledTime(System.currentTimeMillis());
代码示例来源:origin: Netflix/conductor
simpleTask.setInputData(input);
simpleTask.setWorkflowInstanceId(workflowInstance.getWorkflowId());
simpleTask.setWorkflowType(workflowInstance.getWorkflowName());
simpleTask.setStatus(Task.Status.SCHEDULED);
simpleTask.setTaskType(taskToSchedule.getName());
代码示例来源:origin: Netflix/conductor
to.setResponseTimeoutSeconds( from.getResponseTimeoutSeconds() );
to.setWorkflowInstanceId( from.getWorkflowInstanceId() );
to.setWorkflowType( from.getWorkflowType() );
to.setTaskId( from.getTaskId() );
to.setReasonForIncompletion( from.getReasonForIncompletion() );
代码示例来源:origin: Netflix/conductor
dynamicTask.setInputData(input);
dynamicTask.setWorkflowInstanceId(workflowInstance.getWorkflowId());
dynamicTask.setWorkflowType(workflowInstance.getWorkflowName());
dynamicTask.setStatus(Task.Status.SCHEDULED);
dynamicTask.setTaskType(taskToSchedule.getType());
代码示例来源:origin: Netflix/conductor
public Task copy() {
Task copy = new Task();
copy.setCallbackAfterSeconds(callbackAfterSeconds);
copy.setCallbackFromWorker(callbackFromWorker);
copy.setCorrelationId(correlationId);
copy.setInputData(inputData);
copy.setOutputData(outputData);
copy.setReferenceTaskName(referenceTaskName);
copy.setStartDelayInSeconds(startDelayInSeconds);
copy.setTaskDefName(taskDefName);
copy.setTaskType(taskType);
copy.setWorkflowInstanceId(workflowInstanceId);
copy.setWorkflowType(workflowType);
copy.setResponseTimeoutSeconds(responseTimeoutSeconds);
copy.setStatus(status);
copy.setRetryCount(retryCount);
copy.setPollCount(pollCount);
copy.setTaskId(taskId);
copy.setWorkflowTask(workflowTask);
copy.setDomain(domain);
copy.setInputMessage(inputMessage);
copy.setOutputMessage(outputMessage);
copy.setRateLimitPerFrequency(rateLimitPerFrequency);
copy.setRateLimitFrequencyInSeconds(rateLimitFrequencyInSeconds);
copy.setExternalInputPayloadStoragePath(externalInputPayloadStoragePath);
copy.setExternalOutputPayloadStoragePath(externalOutputPayloadStoragePath);
return copy;
}
代码示例来源:origin: com.netflix.conductor/conductor-core
@Override
public List<Task> getMappedTasks(TaskMapperContext taskMapperContext) {
logger.debug("TaskMapperContext {} in SubWorkflowTaskMapper", taskMapperContext);
WorkflowTask taskToSchedule = taskMapperContext.getTaskToSchedule();
Workflow workflowInstance = taskMapperContext.getWorkflowInstance();
String taskId = taskMapperContext.getTaskId();
//Check if the are sub workflow parameters, if not throw an exception, cannot initiate a sub-workflow without workflow params
SubWorkflowParams subWorkflowParams = getSubWorkflowParams(taskToSchedule);
Map<String, Object> resolvedParams = getSubWorkflowInputParameters(workflowInstance, subWorkflowParams);
String subWorkflowName = resolvedParams.get("name").toString();
Integer subWorkflowVersion = getSubWorkflowVersion(resolvedParams, subWorkflowName);
Task subWorkflowTask = new Task();
subWorkflowTask.setTaskType(SubWorkflow.NAME);
subWorkflowTask.setTaskDefName(taskToSchedule.getName());
subWorkflowTask.setReferenceTaskName(taskToSchedule.getTaskReferenceName());
subWorkflowTask.setWorkflowInstanceId(workflowInstance.getWorkflowId());
subWorkflowTask.setWorkflowType(workflowInstance.getWorkflowName());
subWorkflowTask.setCorrelationId(workflowInstance.getCorrelationId());
subWorkflowTask.setScheduledTime(System.currentTimeMillis());
subWorkflowTask.getInputData().put("subWorkflowName", subWorkflowName);
subWorkflowTask.getInputData().put("subWorkflowVersion", subWorkflowVersion);
subWorkflowTask.getInputData().put("workflowInput", taskMapperContext.getTaskInput());
subWorkflowTask.setTaskId(taskId);
subWorkflowTask.setStatus(Task.Status.SCHEDULED);
subWorkflowTask.setWorkflowTask(taskToSchedule);
logger.debug("SubWorkflowTask {} created to be Scheduled", subWorkflowTask);
return Collections.singletonList(subWorkflowTask);
}
代码示例来源:origin: com.netflix.conductor/conductor-core
eventTask.setReferenceTaskName(taskToSchedule.getTaskReferenceName());
eventTask.setWorkflowInstanceId(workflowInstance.getWorkflowId());
eventTask.setWorkflowType(workflowInstance.getWorkflowName());
eventTask.setCorrelationId(workflowInstance.getCorrelationId());
eventTask.setScheduledTime(System.currentTimeMillis());
代码示例来源:origin: com.netflix.conductor/conductor-core
joinTask.setWorkflowInstanceId(workflowInstance.getWorkflowId());
joinTask.setCorrelationId(workflowInstance.getCorrelationId());
joinTask.setWorkflowType(workflowInstance.getWorkflowName());
joinTask.setScheduledTime(System.currentTimeMillis());
joinTask.setInputData(joinInput);
代码示例来源:origin: com.netflix.conductor/conductor-core
userDefinedTask.setReferenceTaskName(taskToSchedule.getTaskReferenceName());
userDefinedTask.setWorkflowInstanceId(workflowInstance.getWorkflowId());
userDefinedTask.setWorkflowType(workflowInstance.getWorkflowName());
userDefinedTask.setCorrelationId(workflowInstance.getCorrelationId());
userDefinedTask.setScheduledTime(System.currentTimeMillis());
代码示例来源:origin: com.netflix.conductor/conductor-core
/**
* This method creates a JOIN task that is used in the {@link this#getMappedTasks(TaskMapperContext)}
* at the end to add a join task to be scheduled after all the fork tasks
*
* @param workflowInstance: A instance of the {@link Workflow} which represents the workflow being executed.
* @param joinWorkflowTask: A instance of {@link WorkflowTask} which is of type {@link TaskType#JOIN}
* @param joinInput: The input which is set in the {@link Task#setInputData(Map)}
* @return a new instance of {@link Task} representing a {@link SystemTaskType#JOIN}
*/
@VisibleForTesting
Task createJoinTask(Workflow workflowInstance, WorkflowTask joinWorkflowTask, HashMap<String, Object> joinInput) {
Task joinTask = new Task();
joinTask.setTaskType(SystemTaskType.JOIN.name());
joinTask.setTaskDefName(SystemTaskType.JOIN.name());
joinTask.setReferenceTaskName(joinWorkflowTask.getTaskReferenceName());
joinTask.setWorkflowInstanceId(workflowInstance.getWorkflowId());
joinTask.setWorkflowType(workflowInstance.getWorkflowName());
joinTask.setCorrelationId(workflowInstance.getCorrelationId());
joinTask.setScheduledTime(System.currentTimeMillis());
joinTask.setInputData(joinInput);
joinTask.setTaskId(IDGenerator.generate());
joinTask.setStatus(Task.Status.IN_PROGRESS);
joinTask.setWorkflowTask(joinWorkflowTask);
return joinTask;
}
代码示例来源:origin: com.netflix.conductor/conductor-core
@Override
public List<Task> getMappedTasks(TaskMapperContext taskMapperContext) {
logger.debug("TaskMapperContext {} in WaitTaskMapper", taskMapperContext);
WorkflowTask taskToSchedule = taskMapperContext.getTaskToSchedule();
Workflow workflowInstance = taskMapperContext.getWorkflowInstance();
String taskId = taskMapperContext.getTaskId();
Map<String, Object> waitTaskInput = parametersUtils.getTaskInputV2(taskMapperContext.getTaskToSchedule().getInputParameters(),
workflowInstance, taskId, null);
Task waitTask = new Task();
waitTask.setTaskType(Wait.NAME);
waitTask.setTaskDefName(taskMapperContext.getTaskToSchedule().getName());
waitTask.setReferenceTaskName(taskMapperContext.getTaskToSchedule().getTaskReferenceName());
waitTask.setWorkflowInstanceId(workflowInstance.getWorkflowId());
waitTask.setWorkflowType(workflowInstance.getWorkflowName());
waitTask.setCorrelationId(workflowInstance.getCorrelationId());
waitTask.setScheduledTime(System.currentTimeMillis());
waitTask.setInputData(waitTaskInput);
waitTask.setTaskId(taskId);
waitTask.setStatus(Task.Status.IN_PROGRESS);
waitTask.setWorkflowTask(taskToSchedule);
return Collections.singletonList(waitTask);
}
}
代码示例来源:origin: com.netflix.conductor/conductor-common
public Task copy() {
Task copy = new Task();
copy.setCallbackAfterSeconds(callbackAfterSeconds);
copy.setCallbackFromWorker(callbackFromWorker);
copy.setCorrelationId(correlationId);
copy.setInputData(inputData);
copy.setOutputData(outputData);
copy.setReferenceTaskName(referenceTaskName);
copy.setStartDelayInSeconds(startDelayInSeconds);
copy.setTaskDefName(taskDefName);
copy.setTaskType(taskType);
copy.setWorkflowInstanceId(workflowInstanceId);
copy.setWorkflowType(workflowType);
copy.setResponseTimeoutSeconds(responseTimeoutSeconds);
copy.setStatus(status);
copy.setRetryCount(retryCount);
copy.setPollCount(pollCount);
copy.setTaskId(taskId);
copy.setWorkflowTask(workflowTask);
copy.setDomain(domain);
copy.setInputMessage(inputMessage);
copy.setOutputMessage(outputMessage);
copy.setRateLimitPerFrequency(rateLimitPerFrequency);
copy.setRateLimitFrequencyInSeconds(rateLimitFrequencyInSeconds);
copy.setExternalInputPayloadStoragePath(externalInputPayloadStoragePath);
copy.setExternalOutputPayloadStoragePath(externalOutputPayloadStoragePath);
return copy;
}
内容来源于网络,如有侵权,请联系作者删除!