As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
public static void main(String[] args) { // Create Activiti process engine ProcessEngine processEngine = ProcessEngineConfiguration .createStandaloneProcessEngineConfiguration() .buildProcessEngine(); // Get Activiti services RepositoryService repositoryService = processEngine.getRepositoryService(); RuntimeService runtimeService = processEngine.getRuntimeService(); // Deploy the process definition DeploymentBuilder dep = repositoryService.createDeployment(); dep.addClasspathResource("process-1.bpmn20.xml"); dep.deploy(); // Start a process instance String procId = runtimeService.startProcessInstanceByKey("Process-1").getId(); …..
<?xml version="1.0" encoding="UTF-8"?><definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlnsmgdc="http://www.omg.org/spec/DD/20100524/DC" xmlnsmgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/test"> <process id="Process-1" name="process-1"> <documentation>Place documentation for the 'process-1' process here.</documentation> <startEvent id="startevent1" name="Start"></startEvent> <sequenceFlow id="flow1" name="" sourceRef="startevent1" targetRef="servicetask1"></sequenceFlow> <parallelGateway id="parallelgateway1" name="Parallel Gateway"></parallelGateway> <sequenceFlow id="flow3" name="" sourceRef="parallelgateway1" targetRef="servicetask3"></sequenceFlow> <sequenceFlow id="flow4" name="" sourceRef="parallelgateway1" targetRef="servicetask2"></sequenceFlow> <sequenceFlow id="flow5" name="" sourceRef="servicetask1" targetRef="parallelgateway1"></sequenceFlow> <inclusiveGateway id="inclusivegateway1" name="Inclusive Gateway"></inclusiveGateway> <sequenceFlow id="flow6" name="" sourceRef="servicetask3" targetRef="inclusivegateway1"></sequenceFlow> <sequenceFlow id="flow7" name="" sourceRef="servicetask2" targetRef="inclusivegateway1"></sequenceFlow> <endEvent id="endevent2" name="End"></endEvent> <sequenceFlow id="flow8" name="" sourceRef="inclusivegateway1" targetRef="endevent2"></sequenceFlow> <serviceTask id="servicetask1" name="Task 1" activiti:class="com.tieroneoss.tnp.workflow.TnpServiceTask"></serviceTask> <serviceTask id="servicetask2" name="Parallel Task 2" activiti:async="true" activiti:class="com.tieroneoss.tnp.workflow.TnpService3"></serviceTask> <serviceTask id="servicetask3" name="Parallel Task 1" activiti:async="true" activiti:class="com.tieroneoss.tnp.workflow.TnpService5"></serviceTask> </process></definitions>
ProcessEngine processEngine = ProcessEngineConfiguration.createStandaloneProcessEngineConfiguration().buildProcessEngine();
ProcessEngine processEngine = ProcessEngineConfiguration .createProcessEngineConfigurationFromResource("activiti.cfg.xml") .buildProcessEngine();
<property name="jobExecutorActivate" value="true" />