Flowable-engine in OSGi - Tutorials/examples?


#1

I am trying to use Flowable-engine v6.4.0 on Felix Framework. Unfortunately, I do not appear to successfully instantiate a ProcessEngineConfiguration.

Is there a functional example/tutorial available for using Flowable-engine in OSGi?

Thanks in advance


Flowable-engine in OSGi - Use of delegateExpression attribute resulting in bean not found issue
Classloading issues running flowable 6.4.0 on Karaf
#2

There is an example re OSGi and Activiti in the Activiti in Action book.

I also found this post: http://wrongtracks.blogspot.com/2013/06/using-activiti-engine-as-bundle-in.html


#3

Thanks for the input.
The last link you provided helped me solving some problems instantiating a Process Engine due to modules I was missing.


#4

After solving instantiating the Process Engine based on the information using Flowable-engine v5.23.0 on Felix Framework, while calling RuntimeService.startProcessInstanceByKey() I get some class loading issues for classes used in the activity delegate that are imported from another bundle:

java.lang.NoClassDefFoundError: <My Class URL>
	at java.lang.Class.getDeclaredMethods0(Native Method)
	at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
	at java.lang.Class.getDeclaredMethod(Unknown Source)
	at java.io.ObjectStreamClass.getPrivateMethod(Unknown Source)
	at java.io.ObjectStreamClass.access$1700(Unknown Source)
	at java.io.ObjectStreamClass$3.run(Unknown Source)
	at java.io.ObjectStreamClass$3.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.io.ObjectStreamClass.<init>(Unknown Source)
	at java.io.ObjectStreamClass.lookup(Unknown Source)
	at java.io.ObjectOutputStream.writeObject0(Unknown Source)
	at java.io.ObjectOutputStream.writeObject(Unknown Source)
	at org.activiti.engine.impl.variable.SerializableType.serialize(SerializableType.java:93)
	at org.activiti.engine.impl.variable.SerializableType.setValue(SerializableType.java:69)
	at org.activiti.engine.impl.persistence.entity.VariableInstanceEntity.setValue(VariableInstanceEntity.java:178)
	at org.activiti.engine.impl.persistence.entity.VariableInstanceEntity.create(VariableInstanceEntity.java:74)
	at org.activiti.engine.impl.persistence.entity.VariableInstanceEntity.createAndInsert(VariableInstanceEntity.java:60)
	at org.activiti.engine.impl.persistence.entity.VariableScopeImpl.createVariableInstance(VariableScopeImpl.java:895)
	at org.activiti.engine.impl.persistence.entity.ExecutionEntity.createVariableInstance(ExecutionEntity.java:1194)
	at org.activiti.engine.impl.persistence.entity.VariableScopeImpl.createVariableLocal(VariableScopeImpl.java:808)
	at org.activiti.engine.impl.persistence.entity.VariableScopeImpl.createVariableLocal(VariableScopeImpl.java:795)
	at org.activiti.engine.impl.persistence.entity.VariableScopeImpl.setVariable(VariableScopeImpl.java:689)
	at org.activiti.engine.impl.persistence.entity.VariableScopeImpl.setVariable(VariableScopeImpl.java:646)
	at org.activiti.engine.impl.persistence.entity.VariableScopeImpl.setVariables(VariableScopeImpl.java:590)
	at org.activiti.engine.impl.cmd.StartProcessInstanceCmd.initializeVariables(StartProcessInstanceCmd.java:122)
	at org.activiti.engine.impl.cmd.StartProcessInstanceCmd.execute(StartProcessInstanceCmd.java:107)
	at org.activiti.engine.impl.cmd.StartProcessInstanceCmd.execute(StartProcessInstanceCmd.java:37)
	at org.activiti.engine.impl.interceptor.CommandInvoker.execute(CommandInvoker.java:24)
	at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:57)
	at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:31)
	at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:40)
	at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:35)
	at org.activiti.engine.impl.RuntimeServiceImpl.startProcessInstanceByKey(RuntimeServiceImpl.java:82)
	at 
...
	at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: <My Class Name>
	at java.net.URLClassLoader.findClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at org.apache.felix.framework.BundleWiringImpl.doImplicitBootDelegation(BundleWiringImpl.java:1817)
	at org.apache.felix.framework.BundleWiringImpl.tryImplicitBootDelegation(BundleWiringImpl.java:1746)
	at org.apache.felix.framework.BundleWiringImpl.searchDynamicImports(BundleWiringImpl.java:1699)
	at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1575)
	at org.apache.felix.framework.BundleWiringImpl.access$300(BundleWiringImpl.java:79)
	at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1982)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	... 63 more

Even though I have the packages properly set in <Import-Package>, I keep my process failed to start for this reason.
Has anyone met that issue?


#5

We had no classloading issues with flowable 5.23.0 and Karaf. Since the bundle containing the process engine can not know all Java Delegate classes, we added

<DynamicImport-Package>*</DynamicImport-Package>

to the bundle.

Do you use org.activiti.osgi.blueprint.ProcessEngineFactoryWithELResolver as processEngineFactory?


#6

I have already <DynamicImport-Package>*</DynamicImport-Package> set on that bundle.

As per org.activiti.osgi.blueprint.ProcessEngineFactoryWithELResolver as processEngineFactory, I do not have any blueprint in my bundle (not too familiar with). I am programatically instantiating the Process Engine using a StandaloneInMemProcessEngineConfiguration.


#7

The error mentioned above was caused by the OSGi service/interface instance I was sending as a variable (while being serialized).
Still, after commenting all references to that interface in the code in my Flowable-based bundle, class loading issues appeared in regard to the custom delegate used in the first task of the process.

From:

<serviceTask id=“XYZ” name=“ABC” activiti:class=“my.delegates.CustomDelegate” >

The error is:

“org.activiti.engine.ActivitiClassLoadingException: Class not found: my.delegates.CustomDelegate
at org.activiti.engine.impl.util.ReflectUtil.loadClass(ReflectUtil.java:87)
at org.activiti.engine.impl.util.ReflectUtil.instantiate(ReflectUtil.java:134)
at org.activiti.engine.impl.bpmn.helper.ClassDelegate.defaultInstantiateDelegate(ClassDelegate.java:238)
at org.activiti.engine.impl.bpmn.helper.ClassDelegate.instantiateDelegate(ClassDelegate.java:228)
at org.activiti.engine.impl.bpmn.helper.ClassDelegate.getActivityBehaviorInstance(ClassDelegate.java:207)
at org.activiti.engine.impl.bpmn.helper.ClassDelegate.execute(ClassDelegate.java:151)
at org.activiti.engine.impl.pvm.runtime.AtomicOperationActivityExecute.execute(AtomicOperationActivityExecute.java:60)
at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:97)
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:650)
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:643)
at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionNotifyListenerStart.eventNotificationsCompleted(AtomicOperationTransitionNotifyListenerStart.java:52)
at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:56)
at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:97)
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:650)
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:643)
at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:49)
at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:97)
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:650)
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:643)
at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionCreateScope.execute(AtomicOperationTransitionCreateScope.java:49)
at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:97)
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:650)
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:643)
at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionNotifyListenerTake.execute(AtomicOperationTransitionNotifyListenerTake.java:80)
at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:97)
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:650)
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:643)
at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionDestroyScope.execute(AtomicOperationTransitionDestroyScope.java:116)
at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:97)
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:650)
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:643)
at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionNotifyListenerEnd.eventNotificationsCompleted(AtomicOperationTransitionNotifyListenerEnd.java:35)
at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:56)
at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:97)
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:650)
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:643)
at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:49)
at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:97)
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:650)
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:643)
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.take(ExecutionEntity.java:460)
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.take(ExecutionEntity.java:438)
at org.activiti.engine.impl.bpmn.behavior.BpmnActivityBehavior.performOutgoingBehavior(BpmnActivityBehavior.java:140)
at org.activiti.engine.impl.bpmn.behavior.BpmnActivityBehavior.performDefaultOutgoingBehavior(BpmnActivityBehavior.java:66)
at org.activiti.engine.impl.bpmn.behavior.FlowNodeActivityBehavior.leave(FlowNodeActivityBehavior.java:44)
at org.activiti.engine.impl.bpmn.behavior.FlowNodeActivityBehavior.execute(FlowNodeActivityBehavior.java:36)
at org.activiti.engine.impl.pvm.runtime.AtomicOperationActivityExecute.execute(AtomicOperationActivityExecute.java:60)
at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:97)
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:650)
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:643)
at org.activiti.engine.impl.pvm.runtime.AtomicOperationProcessStartInitial.eventNotificationsCompleted(AtomicOperationProcessStartInitial.java:45)
at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:56)
at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:97)
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:650)
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:643)
at org.activiti.engine.impl.pvm.runtime.AtomicOperationProcessStart.eventNotificationsCompleted(AtomicOperationProcessStart.java:64)
at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:56)
at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:97)
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:650)
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:643)
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.start(ExecutionEntity.java:388)
at org.activiti.engine.impl.cmd.StartProcessInstanceCmd.execute(StartProcessInstanceCmd.java:115)
at org.activiti.engine.impl.cmd.StartProcessInstanceCmd.execute(StartProcessInstanceCmd.java:37)
at org.activiti.engine.impl.interceptor.CommandInvoker.execute(CommandInvoker.java:24)
at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:57)
at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:31)
at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:40)
at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:35)
at org.activiti.engine.impl.RuntimeServiceImpl.startProcessInstanceByKey(RuntimeServiceImpl.java:82)”

I must be missing something either in the OSGi configuration of the bundle, or in the bundles itself, but I cannot figure this out.


#8

You should give the ProcessEngineFactoryWithELResolver a try, I guess, it influences the classloading behaviour. You can configure the bean without having blueprint, the bean property ‘blueprintContextELResolver’ can be null:

    <bean id="blueprintELResolver" class="org.activiti.osgi.blueprint.BlueprintELResolver" />

    <bean id="processEngineFactory" class="org.activiti.osgi.blueprint.ProcessEngineFactoryWithELResolver" init-method="init" destroy-method="destroy">
    		<property name="processEngineConfiguration" ref="processEngineConfiguration" />
    		<property name="bundle" ref="blueprintBundle" />
    		<property name="blueprintELResolver" ref="blueprintELResolver" />
    </bean>

#9

Using the blueprint as:

<bean id="processEngineConfiguration" class="org.activiti.engine.impl.cfg.StandaloneInMemProcessEngineConfiguration" ext:field-injection="true">
    <property name="dataSource" ref="dataSource" />
    <property name="databaseSchemaUpdate" value="true" />
    <property name="asyncExecutorActivate" value="true" />
    <property name="disableIdmEngine" value="true" />
    <property name="resolverFactories">
        <list>
            <bean class="org.activiti.engine.impl.scripting.VariableScopeResolverFactory" />
        </list>
    </property>
</bean>

<bean id="blueprintELResolver" class="org.activiti.osgi.blueprint.BlueprintELResolver" />

<bean id="processEngineFactory" class="org.activiti.osgi.blueprint.ProcessEngineFactoryWithELResolver" init-method="init" destroy-method="destroy">
    <property name="processEngineConfiguration" ref="processEngineConfiguration" />
    <property name="bundle" ref="blueprintBundle" />
    <property name="blueprintELResolver" ref="blueprintELResolver" />
</bean>
<reference id="dataSource" interface="javax.sql.DataSource" />

I still get a class loading related error:

org.activiti.engine.impl.interceptor.CommandContext - Error while closing command context
org.activiti.engine.ActivitiException: couldn’t instantiate class my.delegates.CustomDelegate
at org.activiti.engine.impl.util.ReflectUtil.instantiate(ReflectUtil.java:137) ~[flowable-engine-5.23.0.jar:5.23.0]
at org.activiti.engine.impl.bpmn.helper.ClassDelegate.defaultInstantiateDelegate(ClassDelegate.java:238) ~[flowable-engine-5.23.0.jar:5.23.0]
at org.activiti.engine.impl.bpmn.helper.ClassDelegate.instantiateDelegate(ClassDelegate.java:228) ~[flowable-engine-5.23.0.jar:5.23.0]
at org.activiti.engine.impl.bpmn.helper.ClassDelegate.getActivityBehaviorInstance(ClassDelegate.java:207) ~[flowable-engine-5.23.0.jar:5.23.0]
at org.activiti.engine.impl.bpmn.helper.ClassDelegate.execute(ClassDelegate.java:151) ~[flowable-engine-5.23.0.jar:5.23.0]
at org.activiti.engine.impl.pvm.runtime.AtomicOperationActivityExecute.execute(AtomicOperationActivityExecute.java:60) ~[flowable-engine-5.23.0.jar:5.23.0]
at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:97) ~[flowable-engine-5.23.0.jar:5.23.0]
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:650) ~[flowable-engine-5.23.0.jar:5.23.0]
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:643) ~[flowable-engine-5.23.0.jar:5.23.0]
at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionNotifyListenerStart.eventNotificationsCompleted(AtomicOperationTransitionNotifyListenerStart.java:52) ~[flowable-engine-5.23.0.jar:5.23.0]
at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:56) ~[flowable-engine-5.23.0.jar:5.23.0]
at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:97) ~[flowable-engine-5.23.0.jar:5.23.0]
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:650) ~[flowable-engine-5.23.0.jar:5.23.0]
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:643) ~[flowable-engine-5.23.0.jar:5.23.0]
at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:49) ~[flowable-engine-5.23.0.jar:5.23.0]
at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:97) ~[flowable-engine-5.23.0.jar:5.23.0]
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:650) ~[flowable-engine-5.23.0.jar:5.23.0]
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:643) ~[flowable-engine-5.23.0.jar:5.23.0]
at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionCreateScope.execute(AtomicOperationTransitionCreateScope.java:49) ~[flowable-engine-5.23.0.jar:5.23.0]
at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:97) ~[flowable-engine-5.23.0.jar:5.23.0]
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:650) ~[flowable-engine-5.23.0.jar:5.23.0]
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:643) ~[flowable-engine-5.23.0.jar:5.23.0]
at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionNotifyListenerTake.execute(AtomicOperationTransitionNotifyListenerTake.java:80) ~[flowable-engine-5.23.0.jar:5.23.0]
at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:97) ~[flowable-engine-5.23.0.jar:5.23.0]
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:650) ~[flowable-engine-5.23.0.jar:5.23.0]
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:643) ~[flowable-engine-5.23.0.jar:5.23.0]
at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionDestroyScope.execute(AtomicOperationTransitionDestroyScope.java:116) ~[flowable-engine-5.23.0.jar:5.23.0]
at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:97) ~[flowable-engine-5.23.0.jar:5.23.0]
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:650) ~[flowable-engine-5.23.0.jar:5.23.0]
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:643) ~[flowable-engine-5.23.0.jar:5.23.0]
at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionNotifyListenerEnd.eventNotificationsCompleted(AtomicOperationTransitionNotifyListenerEnd.java:35) ~[flowable-engine-5.23.0.jar:5.23.0]
at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:56) ~[flowable-engine-5.23.0.jar:5.23.0]
at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:97) ~[flowable-engine-5.23.0.jar:5.23.0]
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:650) ~[flowable-engine-5.23.0.jar:5.23.0]
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:643) ~[flowable-engine-5.23.0.jar:5.23.0]
at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:49) ~[flowable-engine-5.23.0.jar:5.23.0]
at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:97) ~[flowable-engine-5.23.0.jar:5.23.0]
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:650) ~[flowable-engine-5.23.0.jar:5.23.0]
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:643) ~[flowable-engine-5.23.0.jar:5.23.0]
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.take(ExecutionEntity.java:460) ~[flowable-engine-5.23.0.jar:5.23.0]
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.take(ExecutionEntity.java:438) ~[flowable-engine-5.23.0.jar:5.23.0]
at org.activiti.engine.impl.bpmn.behavior.BpmnActivityBehavior.performOutgoingBehavior(BpmnActivityBehavior.java:140) ~[flowable-engine-5.23.0.jar:5.23.0]
at org.activiti.engine.impl.bpmn.behavior.BpmnActivityBehavior.performDefaultOutgoingBehavior(BpmnActivityBehavior.java:66) ~[flowable-engine-5.23.0.jar:5.23.0]
at org.activiti.engine.impl.bpmn.behavior.FlowNodeActivityBehavior.leave(FlowNodeActivityBehavior.java:44) ~[flowable-engine-5.23.0.jar:5.23.0]
at org.activiti.engine.impl.bpmn.behavior.FlowNodeActivityBehavior.execute(FlowNodeActivityBehavior.java:36) ~[flowable-engine-5.23.0.jar:5.23.0]
at org.activiti.engine.impl.pvm.runtime.AtomicOperationActivityExecute.execute(AtomicOperationActivityExecute.java:60) ~[flowable-engine-5.23.0.jar:5.23.0]
at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:97) ~[flowable-engine-5.23.0.jar:5.23.0]
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:650) ~[flowable-engine-5.23.0.jar:5.23.0]
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:643) ~[flowable-engine-5.23.0.jar:5.23.0]
at org.activiti.engine.impl.pvm.runtime.AtomicOperationProcessStartInitial.eventNotificationsCompleted(AtomicOperationProcessStartInitial.java:45) ~[flowable-engine-5.23.0.jar:5.23.0]
at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:56) ~[flowable-engine-5.23.0.jar:5.23.0]
at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:97) ~[flowable-engine-5.23.0.jar:5.23.0]
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:650) ~[flowable-engine-5.23.0.jar:5.23.0]
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:643) ~[flowable-engine-5.23.0.jar:5.23.0]
at org.activiti.engine.impl.pvm.runtime.AtomicOperationProcessStart.eventNotificationsCompleted(AtomicOperationProcessStart.java:64) ~[flowable-engine-5.23.0.jar:5.23.0]
at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:56) ~[flowable-engine-5.23.0.jar:5.23.0]
at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:97) [flowable-engine-5.23.0.jar:5.23.0]
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:650) ~[flowable-engine-5.23.0.jar:5.23.0]
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:643) ~[flowable-engine-5.23.0.jar:5.23.0]
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.start(ExecutionEntity.java:388) ~[flowable-engine-5.23.0.jar:5.23.0]
at org.activiti.engine.impl.cmd.StartProcessInstanceCmd.execute(StartProcessInstanceCmd.java:115) ~[flowable-engine-5.23.0.jar:5.23.0]
at org.activiti.engine.impl.cmd.StartProcessInstanceCmd.execute(StartProcessInstanceCmd.java:37) ~[flowable-engine-5.23.0.jar:5.23.0]
at org.activiti.engine.impl.interceptor.CommandInvoker.execute(CommandInvoker.java:24) ~[flowable-engine-5.23.0.jar:5.23.0]
at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:57) [flowable-engine-5.23.0.jar:5.23.0]
at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:31) [flowable-engine-5.23.0.jar:5.23.0]
at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:40) [flowable-engine-5.23.0.jar:5.23.0]
at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:35) [flowable-engine-5.23.0.jar:5.23.0]
at org.activiti.engine.impl.RuntimeServiceImpl.startProcessInstanceByKey(RuntimeServiceImpl.java:82) [flowable-engine-5.23.0.jar:5.23.0]
at []
at java.lang.Thread.run(Thread.java:745) [?:1.8.0_121]
Caused by: org.activiti.engine.ActivitiClassLoadingException: Class not found: com.ge.flowbase.server.orchestration.delegates.CalculationOutputFilesMappingDelegate
at org.activiti.engine.impl.util.ReflectUtil.loadClass(ReflectUtil.java:87) ~[?:?]
at org.activiti.engine.impl.util.ReflectUtil.instantiate(ReflectUtil.java:134) ~[?:?]
… 92 more
Caused by: java.lang.ClassNotFoundException: my.delegates.CustomDelegate
at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ~[?:1.8.0_121]
at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[?:1.8.0_121]
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331) ~[?:1.8.0_121]
at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[?:1.8.0_121]
at java.lang.Class.forName0(Native Method) ~[?:1.8.0_121]
at java.lang.Class.forName(Class.java:348) ~[?:1.8.0_121]
at org.activiti.engine.impl.util.ReflectUtil.loadClass(ReflectUtil.java:291) ~[?:?]
at org.activiti.engine.impl.util.ReflectUtil.loadClass(ReflectUtil.java:68) ~[?:?]
at org.activiti.engine.impl.util.ReflectUtil.instantiate(ReflectUtil.java:134) ~[?:?]
… 92 more


#10

I have solved the issue above:
I can use the activiti:class attribute from without class loading issue. (Still needing to check the use of beans with the activiti:delegateExpression attribute)

In a rush of finalizing my prototype, I made a few mistakes mostly due to the fact I had process-engine and workflow-processor in the same bundle and that I was not using ProcessEngine service exported from the blueprint.

Now, I am facing EL issues in conditional transitions, but they are due to the way my entity are structured.


#11

I am having issues with the activiti:delegateExpression attribute as the bean is not found. Documented under Flowable-engine in OSGi - Use of delegateExpression attribute resulting in bean not found issue


#12

Interesting post re Spring Boot and OSGi: https://stackoverflow.com/questions/30881786/can-spring-boot-be-used-with-osgi-if-not-any-plans-to-have-an-osgi-spring-boot


#13

I have succeeded to finalize my implementation of Flowable (v5.23.0) in OSGi (Felix Framework v6.0.1)

Thanks to everyone’s inputs on the matter (or related topincs)