# Found Flowable 5 process definition, but no compatibility handler on the classpath

**URL:** <https://forum.flowable.org/t/found-flowable-5-process-definition-but-no-compatibility-handler-on-the-classpath/620>\
**Category:** Flowable Engine\
**Created:** [June 6, 2017, 6:43am UTC](https://forum.flowable.org/t/found-flowable-5-process-definition-but-no-compatibility-handler-on-the-classpath/620 "2017-06-06T06:43:27Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![ruzkant](https://avatars.discourse-cdn.com/v4/letter/r/7ea924/32.png) [@ruzkant](https://forum.flowable.org/u/ruzkant)\
**Post date:** [June 6, 2017, 6:43am UTC](https://forum.flowable.org/t/found-flowable-5-process-definition-but-no-compatibility-handler-on-the-classpath/620/1 "2017-06-06T06:43:27Z")

</div>

Hi

In the holiday request example in the manual, if I try and access the current flow element for a process instance I get the following exception:

```
Exception in thread "main" org.flowable.engine.common.api.FlowableException: Found Flowable 5 process definition, but no compatibility handler on the classpath
	at org.flowable.engine.impl.util.Flowable5Util.getFlowable5CompatibilityHandler(Flowable5Util.java:130)
	at org.flowable.engine.impl.util.ProcessDefinitionUtil.getProcess(ProcessDefinitionUtil.java:55)
	at org.flowable.engine.impl.persistence.entity.ExecutionEntityImpl.getCurrentFlowElement(ExecutionEntityImpl.java:260)

```

The Context.getProcessEngineConfiguration() call seems to return null.

I have a similar problem with getIdentityLinks() on a task where I get a NullPointerException because the Context.getCommandContext() returns null.

---

<div class="post-metadata">

**Author:** ![joram](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/joram/32/26_2.png) [@joram](https://forum.flowable.org/u/joram)\
**Post date:** [June 6, 2017, 9:36am UTC](https://forum.flowable.org/t/found-flowable-5-process-definition-but-no-compatibility-handler-on-the-classpath/620/2 "2017-06-06T09:36:42Z")

</div>

Do you have the v5 compatibility enabled? See [http://www.flowable.org/docs/userguide/migration.html#\_v5\_compatibility](http://www.flowable.org/docs/userguide/migration.html#_v5_compatibility)

---

<div class="post-metadata">

**Author:** ![ruzkant](https://avatars.discourse-cdn.com/v4/letter/r/7ea924/32.png) [@ruzkant](https://forum.flowable.org/u/ruzkant)\
**Post date:** [June 6, 2017, 10:23am UTC](https://forum.flowable.org/t/found-flowable-5-process-definition-but-no-compatibility-handler-on-the-classpath/620/3 "2017-06-06T10:23:17Z")

</div>

Thanks for the reply, but just as background I am new to flowable and have no legacy processes and therefore no need for version 5 compatibility.

I worked through the “Getting Started” section holiday request example in the manual, which makes no reference to needing version 5 compatibility.

I have worked through the v6 migration guide to find clues, but I am not able to determine what I am doing that makes it think I want to use version 5. The code seems to allow for two execution paths, and the version 6 one doesn’t seem to want to execute due to the Context static calls failing and I am not sure where the framework initializes those.

---

<div class="post-metadata">

**Author:** ![joram](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/joram/32/26_2.png) [@joram](https://forum.flowable.org/u/joram)\
**Post date:** [June 6, 2017, 1:02pm UTC](https://forum.flowable.org/t/found-flowable-5-process-definition-but-no-compatibility-handler-on-the-classpath/620/4 "2017-06-06T13:02:22Z")

</div>

Sorry for the confusion. Indeed, you should not need to have compatibility jars on the classpath if you’re simply running the getting started against v5.

Where are you calling this getCurrentFlowElement()? It only works while doing an API call or in a JavaDelegate (ie a context must be active). If you call this (after casting I assume, it should not be accessible by default in the returned interface) outside of an API call, it will throw an exception as currently no exception is going on.

So, what’s the code your’e executing that throws this exception?

That being said, I agree the exception being thrown is not correct, it should not mention anything about v5 in this case. I made a small tweak to improve this here: [https://github.com/flowable/flowable-engine/commit/87de80c5ecb7c2946afed4a31f4e9ccb5d075a3f](https://github.com/flowable/flowable-engine/commit/87de80c5ecb7c2946afed4a31f4e9ccb5d075a3f)

---

<div class="post-metadata">

**Author:** ![ruzkant](https://avatars.discourse-cdn.com/v4/letter/r/7ea924/32.png) [@ruzkant](https://forum.flowable.org/u/ruzkant)\
**Post date:** [June 6, 2017, 2:20pm UTC](https://forum.flowable.org/t/found-flowable-5-process-definition-but-no-compatibility-handler-on-the-classpath/620/5 "2017-06-06T14:20:16Z")

</div>

Thanks, here is a minimal piece of code that runs into the problem:

```
    ProcessEngineConfiguration cfg = new StandaloneProcessEngineConfiguration()
            .setJdbcUrl("jdbc:h2:mem:flowable;DB_CLOSE_DELAY=-1").setJdbcUsername("sa").setJdbcPassword("")
            .setJdbcDriver("org.h2.Driver")
            .setDatabaseSchemaUpdate(ProcessEngineConfiguration.DB_SCHEMA_UPDATE_TRUE);
    ProcessEngine processEngine = cfg.buildProcessEngine();
    RepositoryService repositoryService = processEngine.getRepositoryService();
    Deployment deployment = repositoryService.createDeployment().addClasspathResource("holiday-request.bpmn20.xml")
            .deploy();
    RuntimeService runtimeService = processEngine.getRuntimeService();
    ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("holidayRequest");
    processInstance.getCurrentFlowElement();

```

The holiday request xml from here:  
[http://www.flowable.org/docs/userguide/index.html#\_deploying\_a\_process\_definition](http://www.flowable.org/docs/userguide/index.html#_deploying_a_process_definition)

If I run this after cfg.buildProcessEngine() then I get a null answer:  
Context.setProcessEngineConfiguration(  
(ProcessEngineConfigurationImpl) processEngine.getProcessEngineConfiguration());

But the following call now works which didn’t before (also got the same exception):  
org.flowable.bpmn.model.Process p = ProcessDefinitionUtil.getProcess(processInstance.getProcessDefinitionId());

---

<div class="post-metadata">

**Author:** ![ruzkant](https://avatars.discourse-cdn.com/v4/letter/r/7ea924/32.png) [@ruzkant](https://forum.flowable.org/u/ruzkant)\
**Post date:** [June 6, 2017, 2:22pm UTC](https://forum.flowable.org/t/found-flowable-5-process-definition-but-no-compatibility-handler-on-the-classpath/620/6 "2017-06-06T14:22:54Z")

</div>

Note I have the same problem in a CDI environment deployment on WildFly connecting to postgres flowable database…

---

<div class="post-metadata">

**Author:** ![joram](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/joram/32/26_2.png) [@joram](https://forum.flowable.org/u/joram)\
**Post date:** [June 6, 2017, 2:57pm UTC](https://forum.flowable.org/t/found-flowable-5-process-definition-but-no-compatibility-handler-on-the-classpath/620/7 "2017-06-06T14:57:20Z")

</div>

This line

`processInstance.getCurrentFlowElement();`

won’t work when called standalone like here, it only works for example in the JavaDelegate. Furthermore, a process instance won’t ever have a ‘current flow element’, the child executions will have one, but the process instance itself not.

However, imho, the process instance (via the Execution) should not expose getCurrentFlowelement() as a method. This should be on the DelegateExecution only. I’ll investigate why this is exposed this way.

If you want to know what activities currently are active for a process instance, you can use for example the historyService.createHistoricActivityInstanceQuery, providing the process instance id.

---

<div class="post-metadata">

**Author:** ![ruzkant](https://avatars.discourse-cdn.com/v4/letter/r/7ea924/32.png) [@ruzkant](https://forum.flowable.org/u/ruzkant)\
**Post date:** [June 6, 2017, 3:05pm UTC](https://forum.flowable.org/t/found-flowable-5-process-definition-but-no-compatibility-handler-on-the-classpath/620/8 "2017-06-06T15:05:15Z")

</div>

Thanks, I will go read up on the concepts of JavaDelegate’s and child executions.

---

<div class="post-metadata">

**Author:** ![joram](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/joram/32/26_2.png) [@joram](https://forum.flowable.org/u/joram)\
**Post date:** [June 6, 2017, 3:33pm UTC](https://forum.flowable.org/t/found-flowable-5-process-definition-but-no-compatibility-handler-on-the-classpath/620/9 "2017-06-06T15:33:22Z")

</div>

FYI: to avoid confusion, the getCurrentFlowElement() was removed from the Execution interface: [https://github.com/flowable/flowable-engine/commit/2a3554de7aca2476b3b177ca895e16fb3cfd7174](https://github.com/flowable/flowable-engine/commit/2a3554de7aca2476b3b177ca895e16fb3cfd7174)
