实现自己的Processor
/**
* 工作流开始节点
*/
@Component
public class PowerJobProcessor implements BasicProcessor {
@Autowired
private IBlItemService blItemService;
@Override
public ProcessResult process(TaskContext taskContext) throws Exception {
OmsLogger omsLogger = taskContext.getOmsLogger();
omsLogger.info("start to process, current jobParams is {}", taskContext.getJobParams());
//
String jobParam = taskContext.getJobParams();
JSONObject jsonObject = JSONObject.parseObject(jobParam);
Set<String> keys = jsonObject.keySet();
Iterator iterator = keys.iterator();
String paramValue = (String) jsonObject.get(iterator.next().toString());
// 获取工作流上下文
WorkflowContext workflowContext = taskContext.getWorkflowContext();
if ("desay".equals(paramValue)) {
// 给工作流上下文设置参数供后续判断节点使用
workflowContext.appendData2WfContext("org", "desay");
return new ProcessResult(true, "desay blf with powerjob");
} else {
workflowContext.appendData2WfContext("org", "huawei");
return new ProcessResult(true, "huawei blf with powerjob");
}
}
}