Custom policies and default policies
Hi,
I was writing a custom policy in which i came across a situation where i would like to re-use the logic of one of the already available default policies. Is this possible? Can one policy call another policy? If so, can you please provide me with the snippet code of how I can actually do that? Regards, Sripriya. |
4 answers
Policies do not "call" other policies. If you want to re-use a function... you can extend a policy.
Which policy do you want to re-use and how? |
I would like to write a new custom policy that will check for a particular "asset type" and will invoke the Relationship Validation Policy by passing parameters such as:
1. Operator 2. Number of related assets 3. Related Asset Type 4. Relationships Is this possible? |
I am not sure that I fully understood, but the following is a general guideline:
Extend the RelationshipValidationPolicy class. It is defined in the com.ibm.ram.repository.jar (you can get it from .... <wasinstall>/profiles/AppSrvxx/installedApps/RAM1WebApplication.ear/com.ibm.ram.repository.web.war/WEB-INF) Make sure to override the getID() class. If you need more configuration... make sure to call the super.getConfigurationDetail (Locale) ... and add to what's already there. the parameters for that methond is defined as following.
From your test() method... you can test your asset type (use the getRelationshipTypes() method, and call super.test() as needed ... look at the result and go from there. |
Thanks for the help! I will get back to you if I get stuck again :)
Regards, Sripriya |
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.