Drools Workbench enumeration

404 views
Skip to first unread message

Ignacio López Mingo

unread,
Mar 15, 2016, 3:55:18 AM3/15/16
to Drools Usage
Hello everybody, 

I want to use workbench enumeration directly from JAVA Code.

Data model can be use directly from java code because workbench create the model in POJO models, but enumerations store like text files.

Are there any API to manage from JAVA Code the enumerations values?

I know that in workbench can we use JAVA Enumerations, but I can use workbench to manage values and enumerations directly by the user not by a java developer.

So anybody knows can we obtain WB enumerations from java code without manual parse of the text files?

Thanks in advance

Michael Anstis

unread,
Mar 15, 2016, 4:54:32 AM3/15/16
to Drools Usage
Please see my other reply.

We do not support generation of Java enums from the Data Modeller at present.

--
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/f5b0d2db-7935-4e64-95ba-761a92e3cb1e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ignacio López Mingo

unread,
Mar 16, 2016, 2:31:13 AM3/16/16
to Drools Usage
Thanks a lot for your quick answer Michael, but in this case is a distinct question.

I need to obtain the values of the WB Enumeration. I´m looking for a way to obtain the parse values (like Workbench do) without create new code.
Are there any public JAVA API to manage WorkBench enumeration (text files)? 

Thanks again

Michael Anstis

unread,
Mar 16, 2016, 3:06:17 AM3/16/16
to Drools Usage

Sorry, it's not possible without you writing some code. Asset definitions (DRL, Guided Rules, Enumerations etc) are not something we expose with any API. Our usual advise is to use a git java library to clone the Workbench repositories and work with them direct. That said you can access them using Uberfire's VFS abstraction (used by the workbench) and codes in drools-wb to read the enumeration.... but it'll require code on your part.

juan diego morera chaves

unread,
May 29, 2017, 2:04:20 PM5/29/17
to Drools Usage
Hello, about this, do you guys support  Java enums today or it have not been added yet?

Michael Anstis

unread,
Jun 1, 2017, 5:47:12 AM6/1/17
to Drools Usage
Yes we support use of Java enums; but not authoring of Java enums.

The JAR containing the enum should be added to the Project as a dependency. Authoring->Project Editor->Dependencies.  

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.

juan diego morera chaves

unread,
Jun 6, 2017, 2:11:32 PM6/6/17
to Drools Usage
Hello to all.

Actually I fixed it first adding my jar (with all my entities and enums) at: Authoring > Artifact Repository
Then i added as a dependency at: Authoring > Project Editor > Dependencies

After this, for each rule I created I Selected the Data Objects tab, and in there I used the +New Item button to add the new entity types (it adds imports for them at the rule).

And that was all, hope, this extra information can help some one else.
Want to thank you all a very much for the help and very short time of you answer.

Regards
Juan Diego Morera Chaves.
Reply all
Reply to author
Forward
0 new messages