1 of 1 people found this helpful
Yes, I think that you can configure the workitem handlers inside the spring configuration. In that way you can bind all the handlers without touching the code. Take a look at the Drools/jBPM5 spring configuration to see if it's there.. if not I will be glad to add that
Thanks, Mauricio. I didn't find any decent Drools/jBPM 5 spring configuration document, but I found a blog, saying about jBPM5, WorkItemHandler as Spring Bean, http://community.jboss.org/thread/160352 (Michal Minicki posted the following example). It gave me some ideas how Spring can help here. I know Spring framwork is flexible and useful, but I have some reservations (or I am debating) if I have to bring the Spring framework additionally to solve this issue...
<drools:ksession id="jpaSingleSessionCommandService" type="stateful" kbase="knowledgeBase">
<drools:work-item-handler name="Notification" ref="refToNotificationWorkItemHandler" />
<drools:transaction-manager ref="transactionManager" />
<drools:entity-manager-factory ref="entityManagerFactory" />
Is there any jBPM solution, using some configuration files? If not, I am thinking about creating a simple XML-format configuration file (similar to the above), and the code can retrieve a set of service tasks (name) and workitem handlers (ref) and bind them in a loop. Maybe I end up using Spring framework, but...
BTW, is there WorkItem configuration schema or syntax? I saw there are name, parameters, results, displayName, icon and customEditor. Are they a complete list? What other tags I can put? I tried to find its syntax/schema, but no luck so far.
Hi there.. the spring configuration looks fine, that should be your solution. I'm not a spring fan but it looks exactly what you need to solve the problem.
The properties that you are mentioning are used by eclipse to recognize a custom work item and to include it in the palete, that's not related with the work item itself. For each workitem that you define you will end up with the properties specific for that work item.
Hi there.. Yes, the work item configuration is for eclipse palette. In my case, most of service task configurations will be bound to work item handlers (I am thinking about a generic workitem handler that can handle any kind of service tasks - parameters, content-based logic, using java reflection, annotations). So, I briefly thought about if I can add a customized tag (e.g., "binding" : "name of workitem handler" ) in the configuration, I can use this configuration file to extract both service task names and workitem handlers, instead of creating multiple configuration files here and there (or using Spring framework). However, considering decoupling between designer and workitem handlers, it may be not a good idea.
I am still interested in finding the workitem configuration shema/syntax to see if I can customize the schema.