Bug 1078337
Summary: | Unfinished support for Custom Work Item Handlers in business-central | ||||||
---|---|---|---|---|---|---|---|
Product: | [Retired] JBoss BPMS Platform 6 | Reporter: | Anton Giertli <agiertli> | ||||
Component: | Business Central | Assignee: | Maciej Swiderski <mswiders> | ||||
Status: | CLOSED CURRENTRELEASE | QA Contact: | Radovan Synek <rsynek> | ||||
Severity: | high | Docs Contact: | |||||
Priority: | medium | ||||||
Version: | 6.0.0 | CC: | kverlaen, rafaelcba, ravindra.tubati, rsynek, vigoyal | ||||
Target Milestone: | ER1 | ||||||
Target Release: | 6.0.2 | ||||||
Hardware: | Unspecified | ||||||
OS: | Unspecified | ||||||
Whiteboard: | |||||||
Fixed In Version: | Doc Type: | Bug Fix | |||||
Doc Text: |
It was not possible to register Custom Work Item Handlers via Business Central, even though it was possible to add them via Business Central. This has now been fixed by using reflection to register the work item beans.
|
Story Points: | --- | ||||
Clone Of: | Environment: | ||||||
Last Closed: | 2014-08-06 19:50:12 UTC | Type: | Enhancement | ||||
Regression: | --- | Mount Type: | --- | ||||
Documentation: | --- | CRM: | |||||
Verified Versions: | Category: | --- | |||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
Cloudforms Team: | --- | Target Upstream Version: | |||||
Embargoed: | |||||||
Attachments: |
|
Description
Anton Giertli
2014-03-19 15:50:41 UTC
Created attachment 876403 [details]
related files
Raising severity as (correct me if I am wrong) there is no way how to get new work item into business-central runtime (kdeployment) without restarting the server - to put the JAR with work item handler on classpath and register it as Anton described. Given a fact that the handler can be registered in GUI (Project Editor -> Knowledge bases and sessions) and is possible to upload JAR with implementation and use it as a dependency of project, is this issue really enhancement? Actually it does work but the work item handler must be be given as MVEL expression for instance: new org.jbpm.wih.CustomHandler() and that should work for both handlers as maven dependency and when placed in web-inf/lib. Alternatively you can also use CDI based producers, see docs here: http://docs.jboss.org/jbpm/v6.0.1/userguide/jBPMCoreEngine.html#d0e2140 look at section 5.4.4.2.1. Registering handlers and listeners in CDI environment I'll fix the resolution so simple FQCN would work as well. fixed by falling back to reflection based bean created in case MVEL or CDI based ones fail drools master: https://github.com/droolsjbpm/drools/commit/e9611073ea22b68db0ea2e2c28b3e183abdfb71d 6.0.x: https://github.com/droolsjbpm/drools/commit/31cee34c710ba95af442440aa05bbcdbcb18750f Hi Maciej, I have tried two tests, with this kmodule.xml (altered and copied from business-central) : <kmodule xmlns="http://jboss.org/kie/6.0.0/kmodule" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <kbase name="defaultKieBase" default="true" eventProcessingMode="cloud" equalsBehavior="identity" declarativeAgenda="disabled" scope="javax.enterprise.context.ApplicationScoped" packages="*"> <ksession name="defaultKieSession" type="stateful" default="true" clockType="realtime" scope="javax.enterprise.context.ApplicationScoped"> <workItemHandlers> <workItemHandler type="new com.ihealth.sample.helloworld.workitem.SystemOutWorkItemHandler()" name="Service Task"/> </workItemHandlers> </ksession> </kbase> </kmodule> Test 1) Add jar with handler as a dependency. Project build failed with: Unable to complete your request. The following exception occurred: java.lang.ClassNotFoundException:org.kie.api.runtime.process.WorkItemHandler. So do I really need to add kie-api library explicitely ? Test 2) Add jar with handler in WEB-INF/lib. Project built/deployed/executed successfully. Is this expected behavior, Thanks, Anton Anton, that is correct, you need to define dependency to kie-api as handler implements interface from it. Usually handlers are packaged as separate jar and then attached to kjar project. So to be able to build the jar with handler you need to have dependency to kie-api in you maven project. So there is no difference from building it outside of kie-wb and inside it. Hi, I have clarified this with Maciej, and once I have removed <scope>provided</scope> for kie-api dependency from my handler project this works as expected. By expected I mean I have hit this bug https://bugzilla.redhat.com/show_bug.cgi?id=1050196 Once this and above bugzilla are fixed, both ways should work. Anton. (In reply to Anton Giertli from comment #9) > By expected I mean I have hit this bug > https://bugzilla.redhat.com/show_bug.cgi?id=1050196 > > Once this and above bugzilla are fixed, both ways should work. Anton the BZ should already be fixed! Hi Marek, I should have mentioned it explicitly, but 99% of the time I use only those releases which are available to the customers (it's really natural thing for most of the GSS engineers). Now, it is BPM 6.0.0 GA. Looking at that other bugzilla I see it is fixed in the BPMS 6.0.1.ER2, but I haven't tried this version, only GA. I am sorry for the confusion. Cheers, Anton Verified with BPMS-6.0.2.ER2 |