Question

Is it possible to call to method different to GET/SET methods from Guvnor rule wizard?

I have a simple data model in Guvnor, but if I want to create more complex rules, I need to call from my rules to other different methods, that they allow me to develop other complex task. Do I need to upload a data model different to the POJO model??

Although I can write get/set methods complex. This is other possibility. I know that in the left side of a rule I have to put a statement that tell me if something is true or false. But in the right side of the rule, maybe in some case it is possible to need to do a complex action. So, it's in these cases when I need to call to other different methods to get/set methods.

Thank in advance.

Was it helpful?

Solution

The GET/SET methods are only needed for pattern matching on the Left Hand Side of the rule. On the Right Hand Side, you can call any Java code you like.

Note a limitation. You can upload facts with any methods you like. However, you do need to be careful that if by adding those methods you are adding dependencies on external libraries (maybe a method performs database access), then you need to add Jars for those external libraries to the Guvnor classpath (explode the war and copy them into WEB-INF/lib).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top