# Skipping Activity Behavior

**URL:** <https://forum.flowable.org/t/skipping-activity-behavior/426>\
**Category:** Flowable Engine\
**Created:** [March 24, 2017, 5:39pm UTC](https://forum.flowable.org/t/skipping-activity-behavior/426 "2017-03-24T17:39:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![h7kanna](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/h7kanna/32/104_2.png) [@h7kanna](https://forum.flowable.org/u/h7kanna)\
**Post date:** [March 24, 2017, 5:39pm UTC](https://forum.flowable.org/t/skipping-activity-behavior/426/1 "2017-03-24T17:39:00Z")

</div>

Hello,

Firstly, thanks for Flowable (before Activiti), its awesome!

I am trying to figure out how to skip an Activity Behavior, based on some condition without overriding ActivityBehaviorFactory and writing custom behaviors or using implementation specific classes.

For example I have to skip a timer. Please guide me if the following Execution listener implementation will do the trick.  
Execution Listener is set for the timer to invoke on ExecutionListener.EVENTNAME\_START

package example;

import org.flowable.bpmn.model.FlowNode;  
import org.flowable.engine.delegate.DelegateExecution;  
import org.flowable.engine.delegate.DelegateHelper;  
import org.flowable.engine.delegate.ExecutionListener;  
import org.slf4j.Logger;  
import org.slf4j.LoggerFactory;

public class IntermediateCatchEventExecutionListener implements ExecutionListener {

```
private static final Logger LOG = LoggerFactory.getLogger(IntermediateCatchEventExecutionListener.class);

public void notify(DelegateExecution execution) {

    // This is figured out by some external data store
    if (execution.hasVariable("THIS_STEP_ALREADY_HAPPENED")) {

        LOG.info("IntermediateCatchEvent Execution listener " + execution.getCurrentActivityId() + " is going to fire");

        LOG.info("Skipping the timer behavior for " + execution.getCurrentActivityId());

        if (execution.getCurrentFlowElement() instanceof FlowNode) {
            // Set as Noop Behavior or null
            ((FlowNode) execution.getCurrentFlowElement()).setBehavior(null);
        }

        DelegateHelper.leaveDelegate(execution);
    }
}

```

}

Thanks,  
Harsha
