0

In my Fusion Web Application, I have defined several business rules in entity objects. Everything works fine. The problem is that I can not get them programatically. I have searched through the EntityObjects Impl java class, but there is no method that should perform validation. Does anyone know any way, how to get the business rules from an entity object? I need to get at least a list of those.

Update:

EntityDefImpl eoDef = EntityDefImpl.findDefObject("package...MyEO");

            for (Object o : eoDef.getValidators()) {
                System.out.println("Rule: " + o);
            }

But even in this case, I do not get a list of business rules.

pnuts
  • 58,317
  • 11
  • 87
  • 139
Noah Martin
  • 1,708
  • 9
  • 35
  • 73

3 Answers3

2

Try the following instead of your implementation

EntityDefImpl eoDef = EntityDefImpl.findDefObject("package...MyEO");
AttributeDefImpl myAttribute=getAttributeDefImpl("MyAttribute"); //Get the first Attribute

for (Object o : myAttribute.getValidators()) {
            System.out.println("Rule: " + o);
 }

The one you did will get the Entity level validators only, this one will get you this specific attribute validators!

Amr Gawish
  • 2,015
  • 1
  • 17
  • 29
1

Take a look at the EntityDefImpl class. Since it applies to all EO instances it carries the validation.enter link description here

Joe
  • 3,337
  • 1
  • 14
  • 11
  • Thanks for answering, I tried some things, but however I am not able to get a list with the Bussines Rules defined in the view object. I have updated my question with some new code rows. – Noah Martin Nov 14 '13 at 09:37
1

If you just want to call it, you can use the Validate function from ViewObjectImpl (Since you want to call it from the Web Application programmatically or your Application Module)

If you want to add another Validation, then you should follow the first answer.

Amr Gawish
  • 2,015
  • 1
  • 17
  • 29
  • Thanks for answering, ViewObjectImpl.validate() returns nothing. I need to retrieve a list of validations (business rules). – Noah Martin Nov 14 '13 at 08:53