-
1. Workitem handler registration declaratively?
salaboy21 Mar 21, 2011 6:28 AM (in response to byungwoojun)1 of 1 people found this helpfulYes, 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
Greetings.
-
2. Workitem handler registration declaratively?
byungwoojun Mar 22, 2011 1:15 PM (in response to salaboy21)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...
e.g.,
<drools:ksession id="jpaSingleSessionCommandService" type="stateful" kbase="knowledgeBase">
<drools:configuration>
<drools:work-item-handlers>
<drools:work-item-handler name="Notification" ref="refToNotificationWorkItemHandler" />
</drools:work-item-handlers>
<drools:jpa-persistence>
<drools:transaction-manager ref="transactionManager" />
<drools:entity-manager-factory ref="entityManagerFactory" />
</drools:jpa-persistence>
</drools:configuration>
</drools:ksession>
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.
thanks,
bwj
-
3. Workitem handler registration declaratively?
salaboy21 Mar 22, 2011 1:20 PM (in response to byungwoojun)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.
Greetings!
-
4. Workitem handler registration declaratively?
byungwoojun Mar 22, 2011 1:35 PM (in response to salaboy21)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.
thanks,
bwj