flowable 6.3.1
runtimeService.startProcessInstanceByKey(processDefinitionKey, variables);
Error message is
org.springframework.http.converter.HttpMessageNotWritableException: Could not write JSON: Cannot get process model: no current command context is active; nested exception is com.fasterxml.jackson.databind.JsonMappingException: Cannot get process model: no current command context is active (through reference chain: org.flowable.engine.impl.persistence.entity.ExecutionEntityImpl["currentFlowElement"])
at org.springframework.http.converter.json.AbstractJackson2HttpMessageConverter.writeInternal(AbstractJackson2HttpMessageConverter.java:293)
I figure out the reason.
I return processInstance in the controller like fellow, and the error is thrown
@RestController
public class Controller {
@RequestMapping
public ProcessInstance start(Map<String, Object> model){
return runtimeService.startProcessInstanceByKey(processDefinitionKey, variables);
}
}
so please close the issue