Update data model in Drools Workbench

416 views
Skip to first unread message

Marius Lazar

unread,
May 9, 2016, 5:09:38 AM5/9/16
to Drools Usage
I have uploaded a jar containing my data model to workbench through "Artifact repository" and set the version to "1.0-SNAPSHOT". Then I added the jar as a dependency to my project and I have built some rules with it ( no need to add the jar to "Config" because the class inside jar is in the same package ).

Now I want to update the data model. After I generate a new jar with the new data model (added a new property) and upload it again through "Artifact repository", I want to see the new field when I try to update a rule. ( I didn't add the jar to dependency list of the project again because the first time I have set the version to SNAPSHOT, so it should take the right one, and it does, but not the way I want it).

I don't see the new field added nor when I refresh the project or refresh the page ( CTRL+F5 ), but I do see the field if I close the running instance of Workbench + Server ( CTRL+C on command line ) and start it again. ( I use the workbench and server on the same PC and opened them with one command ).

I really need to do the refresh programmatically, without the need of restarting the running instance of workbench + server. Can you give me some guidance ?

Michael Anstis

unread,
May 9, 2016, 5:14:53 AM5/9/16
to Drools Usage
There is a cache of class meta-data extracted from the Project's classes and Project's dependencies.

The cache is cleared whenever a change to the pom.xml, kmodule.xml or Project .java file is detected.

Since you are only uploading a new JAR the Workbench is not detecting any changes and the cache is not cleared.

Try editing the pom.xml after uploading your new JAR (e.g. just change the Project Description and save).  

--
You received this message because you are subscribed to the Google Groups "Drools Usage" group.
To unsubscribe from this group and stop receiving emails from it, send an email to drools-usage...@googlegroups.com.
To post to this group, send email to drools...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/drools-usage/e88ec7e1-14b9-41d0-8864-8abbaf77a2e8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Marius Lazar

unread,
May 9, 2016, 6:05:10 AM5/9/16
to Drools Usage
Thank you, it worked! :)

Michael Anstis

unread,
Apr 24, 2017, 5:32:21 AM4/24/17
to wang Sherry, Drools Usage
Nope, sorry. The cache is "internal" and not for public (API) usage.

What problem do you have? What application server are you using?

On 24 April 2017 at 01:03, wang Sherry <wang...@gmail.com> wrote:
Hi, Michael ,

Is there any API that could be used to refresh the cache?  I changed description in pom.xml each time when generating the JAR and then install it to m2 repository of KIE. It never refresh the cache.... 

Michael Anstis

unread,
Apr 26, 2017, 3:07:17 AM4/26/17
to Drools Usage
---------- Forwarded message ----------


I don't know KIE Server very well. What is this "InstallRequest" of which you speak!?

I assume KIE Server's artifact resolution mechanism is vanilla Maven, in which case whether you want to install or deploy depends on whether KIE Server is running on the same host as your local Maven repository.

If it is; then install should be sufficient; as Maven (used by KIE Server) will first try to resolve artifacts against the local repository. If not; then Maven will fail to resolve locally and try the configured remotes.

I don't know the life-cycle of KIE Server's "container" so an answer for that needs to come from my colleagues.

Please use drools-usage mailing list. 

On 26 April 2017 at 07:31, wang Sherry <wang...@gmail.com> wrote:
Michael, 

Thanks for the reply. The jar file is already been installed into m2 repository on KIE server.  Here is the folder structure of m2 repository after each install.   I am using InstallRequest API to install the jar and pom artifact.  Do I need to Deploy as well? I disposed the container and recreated it again... No new rules were applied...

Inline images 1

On 26 April 2017 at 08:36, Michael Anstis <michael...@gmail.com> wrote:

Seems like you're using KIE Server? Is it KIE Server that is not "seeing" the revised  Snapshots? What is the maven refresh policy for snapshots on the server running KIE Server? It'll only detect updates once a day by default.

On 25 Apr 2017 21:31, "wang Sherry" <wang...@gmail.com> wrote:
Hi, Michael,

I followed your  solution to auto generate kjar. I added the dependency and  install the jar using Install to KIE's maven repository.  Each time new timestamp is added to pom.xml of the kjar. After install, the container is disposed and recreated as well. But it will only take effect after a restart.  I am using latest JBPM 7 Beta8



Thanks
Sherry

Maciej Swiderski

unread,
Apr 26, 2017, 4:51:28 AM4/26/17
to Drools Usage
same here, no idea what is InstallRequest API so could you please elaborate more on this

Maciej

To unsubscribe from this group and stop receiving emails from it, send an email to drools-usage+unsubscribe@googlegroups.com.

To post to this group, send email to drools...@googlegroups.com.

wang Sherry

unread,
Nov 8, 2017, 11:13:38 PM11/8/17
to Drools Usage
OK. It's me again... This problem is still not resolved from my side yet. 

I am now able to get the new dependency artifact kjar detected by changing pom.xml and scanning the container. I can tell the new rules I've added were loaded, but the they just didn't take effect.... I stop the container, start it again. Still not working. I basically invoke the business process with a rule task to invoke the new rule. It kept breaching the old rules even I've removed them already... If anyone has idea, that would be very helpful. Thank you 

wang Sherry

unread,
Nov 8, 2017, 11:29:23 PM11/8/17
to drools...@googlegroups.com
I am wondering if I set my kmodule is wrong?  The dependency KJar (need to be updated often) is generating this kbase TemplateRules.KBase.
But once I restarted the server, everything works fine.
<kmodule xmlns="http://jboss.org/kie/6.0.0/kmodule" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<kbase name="Kbase" default="true" eventProcessingMode="stream" equalsBehavior="identity" packages="chm.bpm.portfolio, chm.bpm.generalrules, chm.bpm.templates" includes="TemplateRules.KBase">
<ksession name="Ksession" type="stateful" default="true" clockType="realtime"/>
<ksession name="KStatelessSession" type="stateless" default="false" clockType="realtime"/>
</kbase>
</kmodule>

--
You received this message because you are subscribed to a topic in the Google Groups "Drools Usage" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/drools-usage/pGDD4HjiaX8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to drools-usage+unsubscribe@googlegroups.com.

To post to this group, send email to drools...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages