Workbench Java Enum usage

191 views
Skip to first unread message

juan diego morera chaves

unread,
May 30, 2017, 6:00:51 PM5/30/17
to Drools Usage
Hello to all and thanks in advance for any help you can give me.

I'm creating some Data Objects to migrate my 5.5.0 rules to the new 6.2.0-final version, and I have some Java Enum Structure, so the tool lets me define the Enum via the "source" section, but cannot reference it from other objects (I need otter objects to have attributes of those Enum class Types). also I have behavior that uses the Enum type.

Example:

public enum PageType {
  FIRSTPAGETYPE,  SECONDPAGETYPE,  THIRDPAGETYPE;
  private ActionType() {}

public enum ActionType {
  FIRSTTYPE,  SECONDTYPE,  THIRDTYPE;
  private ActionType() {}


public class UserRequest {
  //attributes
  private  String cmsId;
  private PageType pageType;      //I cannot reference this attribute of the PageType type
  .  .  .    // etc, etc
 
  // here is an example of the behavior where I need to use the PageType attribute Type
  // even if I paste the code for the method when I call it from the rule it does not show the ActionType attribute
  public void action(String cmsId, ActionType actionType){
      . . .    // etc, etc
  }

}


Hope you can help me to make it work.
Regards

Mark Coble

unread,
Jun 6, 2017, 3:37:23 AM6/6/17
to Drools Usage
Hi Juan

Looks like you might be encountering the  limitations described here: https://groups.google.com/d/topic/drools-usage/f5dlGL2I7Tc/discussion

Mark Coble

unread,
Jun 6, 2017, 3:38:53 AM6/6/17
to Drools Usage
Juan...I missed that you were already on that chain of discussion!


On Tuesday, May 30, 2017 at 11:00:51 PM UTC+1, juan diego morera chaves wrote:

juan diego morera chaves

unread,
Jun 6, 2017, 2:11:35 PM6/6/17
to drools...@googlegroups.com
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.


--
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/uSgS0531ohU/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.
To view this discussion on the web visit https://groups.google.com/d/msgid/drools-usage/06f104f5-8ee5-46ec-b2a5-270e5e53098d%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--


Michael Anstis

unread,
Jun 6, 2017, 2:51:16 PM6/6/17
to Drools Usage
Thanks for providing the feedback.

The process you describe is exactly what we try to communicate. 

If you fancy submitting a PR for kie-docs to better explain how to use enums in the workbench it'll be warmly received. 

--
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+unsubscribe@googlegroups.com.

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

juan diego morera chaves

unread,
Jun 6, 2017, 5:18:02 PM6/6/17
to drools...@googlegroups.com
Hello Michael Anstis

I would be more than happy colabore with this, but I do not know how, let me know the details.

Regards
Juan Diego Morera Chaves.

For more options, visit https://groups.google.com/d/optout.



--


Michael Anstis

unread,
Jun 7, 2017, 4:46:02 AM6/7/17
to Drools Usage
Hi,


Thereafter, the source for the User Guide is here: https://github.com/kiegroup/kie-docs

Fork it, I'd suggest adding changes here explaining anything specific you did for enumerations, and submit a PR.

Thanks,

Mike 

Reply all
Reply to author
Forward
0 new messages