This file contains 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
<bean id="camel" class="org.activiti.camel.CamelBehaviour"> | |
<constructor-arg index="0"> | |
<list> | |
<bean class="org.activiti.camel.SimpleContextProvider"> | |
<constructor-arg index="0" value="camelProcess"/> | |
<constructor-arg index="1" ref="camelProcess"/> | |
</bean> | |
<bean class="org.activiti.camel.SimpleContextProvider"> | |
<constructor-arg index="0" value="asyncCamelProcess"/> | |
<constructor-arg index="1" ref="camelProcess"/> |
This file contains 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
<serviceTask id="serviceTask2" activiti:type="camel"> | |
<extensionElements> | |
<activiti:field name="camelContext" stringValue="customCamelContext" /> | |
</extensionElements> | |
</serviceTask> |
This file contains 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
<camelContext id="camelContext" xmlns="http://camel.apache.org/schema/spring"> | |
<packageScan> | |
<package>org.activiti.camel.route</package> | |
</packageScan> | |
</camelContext> |
This file contains 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
<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" | |
xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="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="camelProcess"> | |
<startEvent id="start" /> | |
<sequenceFlow id="flow1" sourceRef="start" targetRef="camelTask" /> | |
<serviceTask id="camelTask" name="Invoke Camel route" activiti:type="camel" /> |
This file contains 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 AsyncCamelRoute extends RouteBuilder { | |
@Override | |
public void configure() throws Exception { | |
from("activiti:camelProces:camelTask").to("seda:asyncQueue"); | |
from("seda:asyncQueue").to("bean:heavyDutyBean").to("seda:receiveQueue"); // do some integration logic here | |
from("seda:receiveQueue").to("activiti:camelProcess:receiveTask"); | |
} | |
} |
This file contains 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
<beans xmlns="http://www.springframework.org/schema/beans" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"> | |
<bean id="processEngineConfiguration" | |
class="org.flowable.engine.impl.cfg.StandaloneProcessEngineConfiguration"> | |
<property name="jdbcUrl" value="jdbc:h2:mem:flowable;DB_CLOSE_DELAY=1000;MVCC=TRUE" /> | |
<property name="jdbcDriver" value="org.h2.Driver" /> | |
<property name="jdbcUsername" value="sa" /> |
This file contains 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
<?xml version="1.0" encoding="UTF-8"?> | |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<name>Flowable Intro</name> | |
<groupId>org.flowable.examples</groupId> | |
<artifactId>flowable-intro</artifactId> | |
<packaging>jar</packaging> | |
<version>1.0</version> |
This file contains 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
<?xml version="1.0" encoding="UTF-8"?> | |
<definitions id="introExample" | |
xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" | |
xmlns:flowable="http://flowable.org/bpmn" | |
targetNamespace="http://flowable.org/examples"> | |
<process id="intro"> | |
<startEvent id="start"/> |
This file contains 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
@Test | |
public void testIntroProcess() { | |
// Create Flowable engine | |
ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine(); | |
// Get main service interfaces | |
RepositoryService repositoryService = processEngine.getRepositoryService(); | |
RuntimeService runtimeService = processEngine.getRuntimeService(); | |
HistoryService historyService = processEngine.getHistoryService(); |
This file contains 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 IntroTask implements JavaDelegate { | |
public void execute(DelegateExecution execution) { | |
if (execution.hasVariable("intro")) { | |
System.out.println("Intro variable available with value " + execution.getVariable("intro")); | |
execution.setVariable("variablePresent", true); | |
} else { | |
System.out.println("Intro variable not available"); | |
execution.setVariable("variablePresent", false); | |
} |
OlderNewer