This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class DummySerializable implements Serializable { | |
private static final long serialVersionUID = 1L; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BpmnModelInstance modelInstance = Bpmn.createProcess() | |
.name("Example process") | |
.executable() | |
.startEvent() | |
.userTask() | |
.name("Some work to do") | |
.endEvent() | |
.done(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// get the BpmnModelInstance for a deployed process | |
BpmnModelInstance processModel = runtimeService.getBpmnModelInstance("someProcessDefinitionId"); | |
// find all User Tasks | |
ModelElementType taskType = processModel.getModel().getType(UserTask.class); | |
Collection<ModelElementInstance> taskInstances = modelInstance.getModelElementsByType(taskType); | |
// Iterate the tasks ... | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ExampleServiceTask implements JavaDelegate { | |
public void execute(DelegateExecution execution) throws Exception { | |
BpmnModelInstance modelInstance = execution.getBpmnModelInstance(); | |
ServiceTask serviceTask = (ServiceTask) execution.getBpmnModelElementInstance(); | |
// read properties from model: | |
serviceTask.getIoSpecification(); | |
//... | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// who worked on this task? | |
historyService.createUserOperationLogQuery() | |
.taskId("someTaskId") | |
.list(); | |
// all operations performed by a given user | |
historyService.createUserOperationLogQuery() | |
.userId("jonny") | |
.list(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// make sure process instance is started | |
assertNotNull(runtimeService.createProcessInstanceQuery() | |
.processInstanceId(processInstance.getId()) | |
.singleResult()); | |
// make sure the task with id "approveInvoice" & candidate group "backoffice" exists | |
Task task = taskService.createTaskQuery() | |
.taskCandidateGroup("backoffice") | |
.processInstanceId(processInstance.getId()) | |
.taskDefinitionKey("approveInvoice") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
assertThat(processInstance).isStarted() | |
.task().hasDefinitionKey("approveInvoice") | |
.hasCandidateGroup("backoffice") | |
.isNotAssigned(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<bpmn2:serviceTask id="requestScore" name="Request Rating Score"> | |
<bpmn2:extensionElements> | |
<camunda:inputOutput> | |
<camunda:inputParameter name="customer">${ XML(customers).xPath('/customers/customer[1]').element() }</camunda:inputParameter> | |
<camunda:inputParameter name="requestedAmount">${ amount }</camunda:inputParameter> | |
<camunda:inputParameter name="someData"> | |
<camunda:map> | |
<camunda:entry key="a">${b}</camunda:entry> | |
<camunda:entry key="c">${d}</camunda:entry> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression"> | |
<![CDATA[ | |
${ XML(someVariable).xPath('/customers/customer[@id='+customerId+']/@score' ).number() >= 100 } | |
]]> | |
</bpmn2:conditionExpression> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- AFTER (new) --> | |
<serviceTask id="service1" name="Generate Invoice" camunda:asyncAfter="true" | |
camunda:class="my.custom.Delegate" /> | |
<!-- BEFORE --> | |
<serviceTask id="service1" name="Generate Invoice" camunda:asyncBefore="true" | |
camunda:class="my.custom.Delegate" /> | |
OlderNewer