Camunda-BPM-Rest-Api的基本调用

Camunda-BPM-Rest-Api的基本调用

  • 1. 如何执行一个流程(Rest-API官方使用教程)
      • 1.Start the process(通知process-definition):
      • 2.Query for the Task(找到具体的task):
      • 3.Complete the Task(改变task状态):
  • 2. 创建一个流程(官网Model-API)

1. 如何执行一个流程(Rest-API官方使用教程)

Start and step through a process with rest(Camunda官方教程)

1.Start the process(通知process-definition):

rest: http://localhost:8080/engine-rest/process-definition/key/{processDefinitionKey}/start

2.Query for the Task(找到具体的task):

rest: http://localhost:8080/engine-rest/task?processInstanceId={processInstanceId}/

3.Complete the Task(改变task状态):

rest: http://localhost:8080/engine-rest/task/{taskId}/complete

2. 创建一个流程(官网Model-API)

Create a Model(BPMN)
不可以直接使用,仅作为参考

  1. 要从头开始创建新的 BPMN 模型,您必须使用以下方法创建一个空的 BPMN 模型实例
BpmnModelInstance modelInstance = Bpmn.createEmptyModel();
  1. 创建一个 BPMN Definitions元素:
Definitions definitions = modelInstance.newInstance(Definitions.class);
definitions.setTargetNamespace("http://camunda.org/examples");
modelInstance.setDefinitions(definitions);
  1. 创建Process
Process process = modelInstance.newInstance(Process.class);
process.setId("process");
definitions.addChildElement(process);
  1. 创建其他元素(task、startEvent等等)
/** 和创建Process类似**/
  1. 将startEvent、task、gateway等等元素联系起来

你可能感兴趣的:(BPMN,restful,后端,java)