cancel
Showing results for 
Search instead for 
Did you mean: 

Activiti + osgi

bhj2
Champ in-the-making
Champ in-the-making
Does anybody already use activiti with OSGI? Was it a good experience?

Best regards!
30 REPLIES 30

schikkal
Champ in-the-making
Champ in-the-making
We are using activiti engine (not the web tooling) in servicemix/fuse osgi container along with activiti eclipse plugins (for authoring bpmn processes). There may be some corner issues, but for most of our needs for now, it works well.  We had to add some glue code around it for spring and deployment configurations, but that is simple.  We also added  apache karaf (part of servicemix/fuse) shell commands to manage the deployed bpmn defintions and instances (if there is enough interest, we can contribute the karaf commands code to community).

Regards,
-Srinivasan

bhj2
Champ in-the-making
Champ in-the-making
It tried to do it, the JavaDelegate classes I need are found by the classloader but I have the following exception when trying to start a process:

1 sept. 2011 08:46:00 org.activiti.engine.impl.interceptor.CommandContext close
GRAVE: Error while closing command context
org.activiti.engine.ActivitiException: test.activiti.FormEnginePrepareTaskBean doesn't implement org.activiti.engine.delegate.JavaDelegate nor org.activiti.engine.impl.pvm.delegate.ActivityBehavior
at org.activiti.engine.impl.bpmn.helper.ClassDelegate.getActivityBehaviorInstance(ClassDelegate.java:136)
at org.activiti.engine.impl.bpmn.helper.ClassDelegate.execute(ClassDelegate.java:110)
at org.activiti.engine.impl.pvm.runtime.AtomicOperationActivityExecute.execute(AtomicOperationActivityExecute.java:40)
at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:76)
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:481)
at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionNotifyListenerStart.eventNotificationsCompleted(AtomicOperationTransitionNotifyListenerStart.java:48)
at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:52)
at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:76)
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:481)
at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:45)
at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:76)
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:481)
at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionCreateScope.execute(AtomicOperationTransitionCreateScope.java:44)
at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:76)
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:481)
at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionNotifyListenerTake.execute(AtomicOperationTransitionNotifyListenerTake.java:61)
at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:76)
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:481)
at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionDestroyScope.execute(AtomicOperationTransitionDestroyScope.java:111)
at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:76)
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:481)
at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionNotifyListenerEnd.eventNotificationsCompleted(AtomicOperationTransitionNotifyListenerEnd.java:36)
at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:52)
at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:76)
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:481)
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.take(ExecutionEntity.java:326)
at org.activiti.engine.impl.bpmn.behavior.BpmnActivityBehavior.performOutgoingBehavior(BpmnActivityBehavior.java:92)
at org.activiti.engine.impl.bpmn.behavior.BpmnActivityBehavior.performDefaultOutgoingBehavior(BpmnActivityBehavior.java:49)
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:40)
at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:76)
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:481)
at org.activiti.engine.impl.pvm.runtime.AtomicOperationProcessStartInitial.eventNotificationsCompleted(AtomicOperationProcessStartInitial.java:44)
at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:52)
at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:76)
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:481)
at org.activiti.engine.impl.pvm.runtime.AtomicOperationProcessStart.eventNotificationsCompleted(AtomicOperationProcessStart.java:44)
at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:52)
at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:76)
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:481)
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.start(ExecutionEntity.java:280)
at org.activiti.engine.impl.cmd.SubmitStartFormCmd.execute(SubmitStartFormCmd.java:80)
at org.activiti.engine.impl.cmd.SubmitStartFormCmd.execute(SubmitStartFormCmd.java:35)
at org.activiti.engine.impl.interceptor.CommandExecutorImpl.execute(CommandExecutorImpl.java:24)
at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:42)
at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:33)
at org.activiti.engine.impl.FormServiceImpl.submitStartFormData(FormServiceImpl.java:64)
at egovrunnerserver.Activator.start(Activator.java:51)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:783)
at java.security.AccessController.doPrivileged(Native Method)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:774)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:755)
at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:370)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.resume(AbstractBundle.java:374)
at org.eclipse.osgi.framework.internal.core.Framework.resumeBundle(Framework.java:1067)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:561)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:546)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.incFWSL(StartLevelManager.java:459)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.doSetStartLevel(StartLevelManager.java:243)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:440)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:227)
at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:337)

trademak
Star Contributor
Star Contributor
Hi,

The exception says it all doesn't it. The FormEnginePrepareTaskBean needs to implement JavaDelegate or ActivityBehavior.

Best regards,

bhj2
Champ in-the-making
Champ in-the-making
Hi,

The exception says it all doesn't it. The FormEnginePrepareTaskBean needs to implement JavaDelegate or ActivityBehavior.

Best regards,

Yes but what is strange is that my class FormEnginePrepareTaskBean implements JavaDelegate.

public class FormEnginePrepareTaskBean implements JavaDelegate {

private Expression formEngine;

@Override
public void execute(DelegateExecution execution) {
   execution.setVariable("formEngine",
     formEngine.getValue(execution));
}
}

trademak
Star Contributor
Star Contributor
Ok good to know. I think this may have something to do with the OSGi wrapper.
Can you explain a bit more about your setup. Are you using Apache Karaf for example?
Can you post your example project?

Thanks,

bhj2
Champ in-the-making
Champ in-the-making
I'm using eclipse equinox as osgi container and not Apache Karaf.

I'll post my exemple project this afternoon.
Thank you for your help!

bhj2
Champ in-the-making
Champ in-the-making
Here are my two bundles and my test process. In the bundles you will have to add the necessary libraries(mybatis-3.0.4, activiti-engine-5.7 & h2-1.2.132). Sorry for my test i did'nt do a maven project Smiley Sad

Is the project in the form you needed it?


<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"
xmlns:activiti="http://activiti.org/bpmn" targetNamespace="EGovRunnerProcesses">

<process id="MyTestProcess" name="MyTest Process">
  <startEvent id="theStart" activiti:initiator="initiator">
   <extensionElements>
    <activiti:formProperty id="person" type="string" />
    <activiti:formProperty id="reason" type="string" />
   </extensionElements>
  </startEvent>

  <sequenceFlow id='flow1' sourceRef='theStart'
   targetRef='task1' />

  <serviceTask id="task1" name="first task"
   activiti:class="test.FormEnginePrepareTaskBean">
  </serviceTask>

  <sequenceFlow id='flow2' sourceRef='task1'
   targetRef='theEnd' />

  <endEvent id="theEnd" />
</process>

</definitions>

trademak
Star Contributor
Star Contributor
Hi,

I made some first steps in testing this. So the projects you uploaded are fine for me to test.
However I need some more time to investigate this. I'll come back to this in a couple of days.

Best regards,

thay
Champ in-the-making
Champ in-the-making
aha~`` tell a joke    :lol:

Can you tell me what fish net is made, Ann?"

"A lot of little holes tied together with strings." replied the little girl.     Smiley Wink














__________________________________________________________________________________________________
[img]http://farm3.static.flickr.com/2342/2041623397_c86010bb27.jpg[/img]
mcdermott pool cue poison pool cue billiards cues