cancel
Showing results for 
Search instead for 
Did you mean: 

replacing default exclusive gateway behavior

ikaros
Champ in-the-making
Champ in-the-making
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!
2 REPLIES 2

ikaros
Champ in-the-making
Champ in-the-making
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

frederikherema1
Star Contributor
Star Contributor
Thanks for sharing your solution. This is the way it's intended to be used, using the ActivityBehaviourFactory.