-
1. Re: Extending jBPM, Plugging in custom IdentityService imple
tom.baeyens Jun 17, 2009 3:29 AM (in response to shekharv)here's pointers on how to plug your own identity service
in jbpm.cfg.xml, remove the line<import resource="jbpm.identity.cfg.xml" />
and add<transaction-context> <object class="your.package.YourIdentitySessionImpl" /> </transaction-context>
YourIdentitySessionImpl should implement org.jbpm.pvm.internal.identity.spi.IdentitySession
Making this identity pluggable is not our first target, but it was taken into the design. Let us know how it goes. I'll add these notes to the developers guide. And update them with your feedback. -
2. Re: Extending jBPM, Plugging in custom IdentityService imple
shekharv Jun 23, 2009 5:33 AM (in response to shekharv)That is neat!
Works like a charm!
We also are trying out another extension for jbpm from our end. This is similar to what jbpm3 had with regards to CustomTaskInstance(s).
Use Case: Domain specific Task information to be stored in a separate table and linked up via the taskid to the jbpm Task table. Enables some custom extensions and reporting for tasks.
In jBPM4 we added a custom activity:
<custom-task>
Put in the binding for the same using jbpm.user.activities.xml.
Our Custom Activity simply extends the TaskActivity provided out of the box, and over rides the execute method of task creation,
This is where we add the code to also fire off an insert into our custom table with all the information that we need to persist.
And since we need a handle to the Task ID, we cannot simple callsuper(execution)
and instead we have to copy some of the code from execute in TaskActivitypublic void execute(ActivityExecution execution) { JpdlExecution jpdlExecution = execution.getExtension(JpdlExecution.class); TaskImpl task = jpdlExecution.createTask(taskDefinition); CustomTask customTask = new CustomTask(task); customTaskDAO.create(customTask); TaskHandler taskHandler = task.getTaskHandler(); boolean wait = taskHandler.executionCreateTask(task); if (wait) { execution.waitForSignal(); } }
Again wondering if this is the best way to do so? How does the design of jBPM allow for solving this? -
3. Re: Extending jBPM, Plugging in custom IdentityService imple
tom.baeyens Jun 23, 2009 5:48 AM (in response to shekharv)at first sight, this seems to be the right way