Can nobody help me?
I think I need a way to integrate jBPM in the way that it lives the whole time over many client requests which are made through my session bean.
jbpm persists all data which are connected with process in datasource (database). So I reckon after stateless session bean destruction your process will be saved.
Please, seniors correct me if I am not right! Because I am yet a junior in jbpm.
Very good question.
OK, I assume you want the database, hibernate cfg and jbpm cfg hidden from your users/applets, and you want the BPM to actually run on the J2EE server.
The Service Bean implementation actually relies on a couple of service beans.
It's been a while but you basically need to look them up,
Context initial = new InitialContext();
Object obj = initial.lookup(remoteCommandServiceJndiName);
RemoteCommandServiceHome remoteCommandServiceHome = (RemoteCommandServiceHome) PortableRemoteObject.narrow(obj,RemoteCommandServiceHome.class );
remoteCommandService = remoteCommandServiceHome.create();
and then you can use the service reference by sending it commands to execute:
result = remoteCommandService.execute(new GetProcessInstanceCommand(processInstanceId));
It's a really good design, but don't get your hopes up, it's not fully functional.
There are only about 6 command objects in the library, barely enough to get a listing of processes and their definitions. That works well. You can even signal transitions.
I'm patiently waiting to see if someone is going to contribute more commands to check permissions and set actors, get tasks etc...
It might be in there already, but I doubt it. And since the documentation, well , you're on your own.
Please post what you find here though. I'll have to tackle that myself when I'm done with the POJO implementation.