cancel
Showing results for 
Search instead for 
Did you mean: 

Add Listner on sequence flow transition progamatically

gsrinivas10
Champ in-the-making
Champ in-the-making
Hi,
      Can any one tell me how to add a listener on sequence flow transition programatically. Tried with the following code.

            List<ActivitiListener> lActivityListnerList = new LinkedList<ActivitiListener>();
            ActivitiListener lActivitiListner = new ActivitiListener();
            lActivitiListner.setImplementation( CustomExecutionListner.class.getName() );
            lActivitiListner.setImplementationType( ImplementationType.IMPLEMENTATION_TYPE_CLASS );
            lActivitiListner.setEvent( ExecutionListener.EVENTNAME_TAKE ); // perhaps not required as per activiti docs for sequence flow
            lActivityListnerList.add( lActivitiListner );
            SequenceFlow.setExecutionListeners( lActivityListnerList );

And wrote a class CustomExecutionListner extending ExecutionListner. But CustomExecutionListner class is not getting called. Any one tell me how to do this?
1 REPLY 1

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi,

have a look here:
http://activiti.org/userguide/index.html#_hooking_into_process_parsing

example which could help:
org.activiti.examples.bpmn.executionlistener.CustomSequenceFlowBpmnParseHandler

Regards
Martin