I have the following running service. Its an extension of the dish tutorial. combining bpmn with dmn.
@Component
@Slf4j
public class ProcessService {
@Autowired
private RuntimeService runtimeService;
public String getDish(){
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("DishGenerator");
return unsureAboutThisBit;
// how do I get the dish response that was set on the final JavaDelegate task do I save it to a variable?
}
}
My final task int he BPMN looks like this
@Component
public class DishReviewDelegate implements JavaDelegate {
private final Logger logger = LoggerFactory.getLogger(this.getClass());
public void execute(DelegateExecution execution) throws Exception {
logger.info("reviewing output of dish decision");
logger.info("available keys:{}", execution.getVariables().keySet());
String dish = (String) execution.getVariable("dish");
String result = (String) execution.getVariable("result");
logger.info("dish is {} ", dish);
}
}
So my question is this… How do I get the dish value from the ProcessService class - the one that triggers the process?