Wednesday, May 13, 2009

jBPM Deploy Problem "no start activity in process"

I had a jBPM workflow engine running in my OSGi server environment.

Then I updated from 4.0.0 Beta1 to 4.0.0 Beta2. Well there are quite a few changes. The "exclusive" tag turned into "decision" and yeah subprocesses are supported now!
Check the readme.html in your jBPM directory for more details.

Anyway why I write this blog entry is this little bastard. After the update I kept getting the following error message: error: no start activity in process

After a little debugging I found the source of the problem. In your *.jpdl.xml file change
<process name="..." xmlns="http://jbpm.org/4/jpdl">
to
<process name="..." xmlns="http://jbpm.org/4.0/jpdl">

Problem solved.

12 comments:

Anonymous said...

Thanks mate!
i have been struggling about this issue.

then it is solved :p

Flavio Donzé said...

Has been fixed in the 4.0.0.CR1 build.

https://jira.jboss.org/jira/browse/GPD-338

Anonymous said...

Thanks a lot

I didn't had this with JBPM 4 alpha 1. It appeared in JBPM 4.0 first release by July 10th 2009.

JNH

Unknown said...

Thanks man, you saved my day!

Unknown said...

Could you tell me how you were able to access OSGI bundle services through JBPM?

I have been struggling with this for the last few weeks so any help would be greatly appreciated, thanks a lot!

Flavio Donzé said...

Hey Ravid

I made a workaround to call osgi services, I have a class OSGiLookup with a bunch of lookup() methods. The first parameter the service name, second the service method name and n parameter which then are delegated to the service method.

The declaration then looks like this:

<java name="createArchive" class="com.softmodeler.workflow.OSGiLookup" method="lookup">

<arg><object expr="com.softmodeler.service.IArchiveObjectService"/></arg>

<arg><object expr="createArchive"/></arg>

<arg><object expr="#{objectType}"/></arg>

<arg><object expr="#{objectId}"/></arg>



<transition to="deleteTreeNode" />

</java>


greets
Flavio

Flavio Donzé said...

And here the OSGiLookup class:

public class OSGiLookup {

@SuppressWarnings("unchecked")
protected void invokeServiceCall(String name, String methodName, Object... parameters) throws Throwable {
try {
Object service = CommonPlugin.getService(name);

int i = 0;
Class[] classes = new Class[parameters.length];
for (Object obj : parameters) {
classes[i++] = obj.getClass();
}
Method method = service.getClass().getMethod(methodName, classes);
method.invoke(service, parameters);
} catch (InvocationTargetException e) {
throw e.getTargetException();
}
}

public void lookup(String name, String methodName, Object parameter1) throws Throwable {
invokeServiceCall(name, methodName, parameter1);
}

public void lookup(String name, String methodName, Object parameter1, Object parameter2) throws Throwable {
invokeServiceCall(name, methodName, parameter1, parameter2);
}

public void lookup(String name, String methodName, Object parameter1, Object parameter2, Object parameter3)
throws Throwable {
invokeServiceCall(name, methodName, parameter1, parameter2, parameter3);
}

public void lookup(String name, String methodName, Object parameter1, Object parameter2, Object parameter3,
Object parameter4) throws Throwable {
invokeServiceCall(name, methodName, parameter1, parameter2, parameter3, parameter4);
}

public void lookup(String name, String methodName, Object parameter1, Object parameter2, Object parameter3,
Object parameter4, Object parameter5) throws Throwable {
invokeServiceCall(name, methodName, parameter1, parameter2, parameter3, parameter4, parameter5);
}
}

I know it's not the cleanes way, but works for me.
CommonPlugin.getService(name);
Is our way to find the OSGi service.

greets
Flavio

Unknown said...

Hi Flavio,

Thanks a lot! This is great, helps a lot in doing what we need to achieve. Correct, it may not be the cleanest way, but if it works it works.

Just one question though,

When you refer to: CommonPlugin.getService(name)

What package are you using for this?

I was not able to resolve it and the only information I could find on it was regarding this package: org.eclipse.emf.common which had the CommonPlugin class, is it the one you are using? If so, any ideas on how to resolve CommonPlugin?

Thanks once again!

Flavio Donzé said...

Hey Ravid

CommonPlugin is my own class, not part of the eclipse framework.

You can replace this code and use the normal OSGi way to find services e.g.

ServiceReference reference = context.getServiceReference(serviceClassName);
if (reference != null) {
Object service = context.getService(reference);
return service;
}

greets
Flavio

Unknown said...

Sorry if this is a double post, but
how did you get JBPM working inside OSGi? They don't seem to support it, if they do, there is lack of documentation on it.

Were there any docs you followed? If not could you give me some pointers on how you did it?

~Thanks

Flavio Donzé said...

Hey Kim

I'm using spring configure and launch my jbpm environment.
You can find documentation if you google jbpm and spring.
I could use the spring osgi extender if I would like to contribute the jbpm services as OSGi services.
http://www.springsource.org/osgi

I actually only consume OSGi services during my workflows though.

greets
Flavio

generic cialis said...

Hello, I do not agree with the previous commentator - not so simple