replacing default exclusive gateway behavior

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2014 07:18 AM
Hi,
i would like to replace the default org.activiti.engine.impl.bpmn.behavior.ExclusiveGatewayActivityBehavior with a custom implementation.
Can i use any tags like activiti:class in the gateway tag in the process description xml to achieve this (have tried, but without success)? Or can it be done by using the spring configuration file in any way? Also would it be possibe to add my own "type" of gateway to the engine by somehow adding more GatewayActivityBehavior implementations to the engine?
greetings and thanks!
i would like to replace the default org.activiti.engine.impl.bpmn.behavior.ExclusiveGatewayActivityBehavior with a custom implementation.
Can i use any tags like activiti:class in the gateway tag in the process description xml to achieve this (have tried, but without success)? Or can it be done by using the spring configuration file in any way? Also would it be possibe to add my own "type" of gateway to the engine by somehow adding more GatewayActivityBehavior implementations to the engine?
greetings and thanks!
Labels:
- Labels:
-
Archive
2 REPLIES 2

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-08-2014 03:48 AM
Got it working by tweaking the spring configuration:
<bean id="processEngineConfiguration" class="org.activiti.spring.SpringProcessEngineConfiguration">
…
<property name="activityBehaviorFactory" ref="myActivityBehaviorFactory"/>
…
</bean>
<bean id="myActivityBehaviorFactory"
class="de.my.controller.custombehavior.impl.MyActivityBehaviorFactory">
<property name="expressionManager" ref="expressionManager"/>
</bean>
<bean id="expressionManager" class="org.activiti.engine.impl.el.ExpressionManager"/>
In MyActivityBehaviorFactory I overrode the call to:
@Override
public ExclusiveGatewayActivityBehavior createExclusiveGatewayActivityBehavior(ExclusiveGateway exclusiveGateway) {
return new MyExclusiveGatewayActivityBehavior();
}
greetings
<bean id="processEngineConfiguration" class="org.activiti.spring.SpringProcessEngineConfiguration">
…
<property name="activityBehaviorFactory" ref="myActivityBehaviorFactory"/>
…
</bean>
<bean id="myActivityBehaviorFactory"
class="de.my.controller.custombehavior.impl.MyActivityBehaviorFactory">
<property name="expressionManager" ref="expressionManager"/>
</bean>
<bean id="expressionManager" class="org.activiti.engine.impl.el.ExpressionManager"/>
In MyActivityBehaviorFactory I overrode the call to:
@Override
public ExclusiveGatewayActivityBehavior createExclusiveGatewayActivityBehavior(ExclusiveGateway exclusiveGateway) {
return new MyExclusiveGatewayActivityBehavior();
}
greetings
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-10-2014 05:24 AM
Thanks for sharing your solution. This is the way it's intended to be used, using the ActivityBehaviourFactory.
