Skip to content

API Start Process Error : Could not write JSON: Cannot get process model: no current command context is active;  #1152

@dongwenting

Description

@dongwenting

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions