cancel
Showing results for 
Search instead for 
Did you mean: 

How to bind custom ActivityBehavior ?

matat
Champ in-the-making
Champ in-the-making
Hi,
  with activiti-engine 5.9 how can i replace  a  default ActivityBehavior  with a custom one ?
  For example i'd like to bind MyMailActivityBehavior instead of the original MailActivityBehavior to be executed for a mail task

  The question is a generic one, i use activiti in a spring dm/osgi environment and due to class visibility restrictions i have to `adjust` certain aspects.

thank you
3 REPLIES 3

frederikherema1
Star Contributor
Star Contributor
You could plug in a org.activiti.engine.impl.bpmn.parser.BpmnParseListener (look on forum to see example usage) that implements the parseSendTask() method. Here, you have acces to the parsed ActivityImpl before it gets handed to the engine for execution. You could, for example, get the wrapped Activitybehaviour and replace it by your class, ext rating all fields you need from the original persed ActivitiBehaviour (in your case MailActivityBehavior).

Hope this helps…

matat
Champ in-the-making
Champ in-the-making
it works, thank you

saysiva
Champ in-the-making
Champ in-the-making
HOw is the same implemented in Activiti 5.21 version?