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.
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
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.
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.
public static final String RELATIONSHIP_FIELD = "ram_relationship_name"; //$NON-NLS-1$
public static final String RELATIONSHIP_ASSET_TYPE = "ram_relationship_asset_type"; //$NON-NLS-1$
public static final String RELATIONSHIP_ASSET_STATE = "ram_relationship_state"; //$NON-NLS-1$
public static final String RELATIONSHIP_CARDINALITY_TYPE = "ram_cardinality_type"; //$NON-NLS-1$
public static final String RELATIONSHIP_CARDINALITY_VALUE = "ram_cardinality_value"; //$NON-NLS-1$
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.