public abstract class CamelBehavior extends AbstractBpmnActivityBehavior implements ActivityBehavior
Three out-of-the-box implementations of CamelBehavior are provided: (1) CamelBehaviorDefaultImpl: Works just like CamelBehaviour does; copies variables into and out of Camel as or from properties.
(2) CamelBehaviorBodyAsMapImpl: Works by copying variables into and out of Camel using a Map
This class has two subclasses one for Spring and one for CDI, and each having the 3 behavioral implementations discussed above. Alternative implementations for Spring or CDI contexts should
now extend one one or the other.
The chosen implementation can be set using extension elements:
Note also that the manner in which variables are copied to the process engine from Camel has changed. It will always copy Camel properties to the process variables set; they can safely be ignored,
of course, if not required. It will conditionally copy the Camel body to the "camelBody" variable if it is of type java.lang.String, OR it will copy the Camel body to individual variables within
the process engine if it is of type Map
<serviceTask id="serviceTask1" flowable:type="camel">
<extensionElements>
<flowable:field name="camelBehaviorClass" stringValue="org.flowable.camel.impl.CamelBehaviorCamelBodyImpl" />
</extensionElements>
</serviceTask>
| Modifier and Type | Class and Description |
|---|---|
static class |
CamelBehavior.TargetType |
| Modifier and Type | Field and Description |
|---|---|
protected Expression |
camelContext |
protected org.apache.camel.CamelContext |
camelContextObj |
protected List<MapExceptionEntry> |
mapExceptions |
protected CamelBehavior.TargetType |
toTargetType |
multiInstanceActivityBehaviorbpmnActivityBehavior| Constructor and Description |
|---|
CamelBehavior() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
copyVariables(Map<String,Object> variables,
org.apache.camel.Exchange exchange,
FlowableEndpoint endpoint) |
protected void |
copyVariablesToBody(Map<String,Object> variables,
org.apache.camel.Exchange exchange) |
protected void |
copyVariablesToBodyAsMap(Map<String,Object> variables,
org.apache.camel.Exchange exchange) |
protected void |
copyVariablesToProperties(Map<String,Object> variables,
org.apache.camel.Exchange exchange) |
protected FlowableEndpoint |
createEndpoint(DelegateExecution execution,
boolean isV5Execution) |
protected org.apache.camel.Exchange |
createExchange(DelegateExecution activityExecution,
FlowableEndpoint endpoint) |
void |
execute(DelegateExecution execution)
Default behaviour: just leave the activity with no extra functionality.
|
protected FlowableEndpoint |
getEndpoint(String key) |
protected String |
getProcessDefinitionKey(DelegateExecution execution,
boolean isV5Execution) |
protected String |
getStringFromField(Expression expression,
DelegateExecution execution) |
protected boolean |
handleCamelException(org.apache.camel.Exchange exchange,
DelegateExecution execution,
boolean isV5Execution) |
protected boolean |
isASync(DelegateExecution execution) |
protected abstract void |
setAppropriateCamelContext(DelegateExecution execution) |
void |
setCamelContext(Expression camelContext) |
protected abstract void |
setPropertTargetVariable(FlowableEndpoint endpoint) |
protected void |
updateTargetVariables(FlowableEndpoint endpoint) |
executeCompensateBoundaryEvents, findBoundaryEventsForFlowNode, getMultiInstanceActivityBehavior, getProcessDefinition, hasLoopCharacteristics, hasMultiInstanceCharacteristics, leave, setMultiInstanceActivityBehaviorleaveIgnoreConditions, parseActivityType, triggerprotected Expression camelContext
protected org.apache.camel.CamelContext camelContextObj
protected List<MapExceptionEntry> mapExceptions
protected CamelBehavior.TargetType toTargetType
protected abstract void setPropertTargetVariable(FlowableEndpoint endpoint)
protected void updateTargetVariables(FlowableEndpoint endpoint)
protected void copyVariables(Map<String,Object> variables, org.apache.camel.Exchange exchange, FlowableEndpoint endpoint)
public void execute(DelegateExecution execution)
FlowNodeActivityBehaviorexecute in interface ActivityBehaviorexecute in class FlowNodeActivityBehaviorprotected FlowableEndpoint createEndpoint(DelegateExecution execution, boolean isV5Execution)
protected FlowableEndpoint getEndpoint(String key)
protected org.apache.camel.Exchange createExchange(DelegateExecution activityExecution, FlowableEndpoint endpoint)
protected boolean handleCamelException(org.apache.camel.Exchange exchange,
DelegateExecution execution,
boolean isV5Execution)
protected void copyVariablesToProperties(Map<String,Object> variables, org.apache.camel.Exchange exchange)
protected void copyVariablesToBodyAsMap(Map<String,Object> variables, org.apache.camel.Exchange exchange)
protected void copyVariablesToBody(Map<String,Object> variables, org.apache.camel.Exchange exchange)
protected String getProcessDefinitionKey(DelegateExecution execution, boolean isV5Execution)
protected boolean isASync(DelegateExecution execution)
protected abstract void setAppropriateCamelContext(DelegateExecution execution)
protected String getStringFromField(Expression expression, DelegateExecution execution)
public void setCamelContext(Expression camelContext)
Copyright © 2023 Flowable. All rights reserved.