The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

Sammy8306 (4) [Avatar] Offline
#1
I'm having some trouble with the Mule-jBPM integration. It seems that by default, jBPM's ProcessInstance tries to send a message using the MessageService when a process ends. In order to integrate Mule and jBPM, we wire MuleMessageServiceFactory as the messageService in jbpm.cfg.xml. However, the send() method implemented by the MuleMessageService implemention throws a NotImplementedException... Is there something I'm missing here? Seems pretty essential that a process can end without choking, right?
tijs.rademakers (494) [Avatar] Offline
#2
Re: Mule and jBPM
Hi,

The MuleMessageService code says the following:

// TODO This should be replaced by the standard send() method below, which would
// make Mule the default messaging service within jBpm.
public MuleMessage generateMessage(String endpoint,
Object payloadObject,
Map messageProperties,
boolean synchronous) throws Exception
{
return proxy.generateMessage(endpoint, payloadObject, messageProperties, synchronous);
}

public void send(Job job)
{
throw new NotImplementedException("MULE-1219");
}

So you're right the send method is not implemented.
Did you read chapter 11 of the book, which talks about the Mule and jBPM integration? Why do you want to use the send method, instead of the functionality described in chapter 11?

Best regards,

Tijs
Sammy8306 (4) [Avatar] Offline
#3
Re: Mule and jBPM
I read the source (same as you did) and concluded the same thing: don't call it. However, jBPM 3.3.0GA seems to call send() on the active messageprovider (MuleMessageService in this case) when ending a process. In other words, I didn't write any code that calls send() directly, but still this NotImplementedException pops up when the end-state of a process is reached. I don't have the code at hand right now, so I can't really dig into it right now. But it just seems weird that the Mule integration leaves a method unimplemented when jBPM itselfs calls it in a very common use-case (namely ending a process).
Sammy8306 (4) [Avatar] Offline
#4
Re: Mule and jBPM
As found in the end() method of ProcessInstance.java from jBPM 3.3 :

if (messageService != null) {
CleanUpProcessJob job = new CleanUpProcessJob(this);
job.setDueDate(new Date());
messageService.send(job);
}

This is the problem I'm talking about in the previous post.
tijs.rademakers (494) [Avatar] Offline
#5
Re: Mule and jBPM
Sorry for the late response. How did you end up with jBPM 3.3? Because Mule 2.1.2 is packaged with jBPM 3.2.2, so I don't think Mule provides support for jBPM 3.3 as of yet. Or are you using a Snapshot version of Mule?

Best regards,

Tijs
Sammy8306 (4) [Avatar] Offline
#6
Re: Mule and jBPM
> Sorry for the late response.

No problem

> How did you end up with jBPM 3.3? Because Mule 2.1.2 is packaged with jBPM 3.2.2.

Heh, I excluded jBPM 3.2.2 manually (using Maven to build) and included jBPM 3.3. We need 3.3 since it contains many fixes for using a Sybase back-end, which we must use.

So clearly there is a breaking change from Mule's point of view. However I manually patched the MuleMessageService (and consequently MuleMessageServiceFactory) to turn the send() method into a no-op instead of throwing an exception. Everything seems to work fine. However, these kind of 'broken windows' in Mule's jBPM transport make me wonder whether it's really fit for production use. I'll find out soon enough I guess...
tijs.rademakers (494) [Avatar] Offline
#7
Re: Mule and jBPM
Okay that explains it.
To my own experience, the integration Mule provides with jBPM is very thin. We developed our own jBPM integration for a project. However, for simple Mule - jBPM interaction, it works just fine. What kind of functionality will you need? Do you need to do a lot of correlation etc. Then you probably end up writing a bit more code.

Best regards,

Tijs