It's all about the answers!

Ask a question

Policy to set categorization


Rodolpho Ugolini Neto (142) | asked Apr 06 '10, 9:20 p.m.
Hi there,

I'm trying to develop a policy that sets a categorization of an asset based on the type of related assets.

I'm not able to check the type of the related assets using the Policy API.

Is there any samples on how to do this: I need to run a policy inside asset1 and cicle among the related assets, checking the type of each asset. If a specific asset type is found I need to set a categorization on asset1.

Thank you,
Rodolpho

2 answers



permanent link
Peter Walker (168136) | answered Apr 07 '10, 11:46 a.m.
FORUM MODERATOR / JAZZ DEVELOPER
On 4/6/2010 9:22 PM, rugolini wrote:
Hi there,

I'm trying to develop a policy that sets a categorization of an asset
based on the type of related assets.

I'm not able to check the type of the related assets using the Policy
API.

Is there any samples on how to do this: I need to run a policy inside
asset1 and cicle among the related assets, checking the type of each
asset. If a specific asset type is found I need to set a
categorization on asset1.

Thank you,
Rodolpho


Although there is not a sample to do exactly what you require, there is
documentation and a sample jar shipped with RAM. Refer to the help topic
"Creating custom policies by using the custom policy review API" in the
RAM info center -->
http://publib.boulder.ibm.com/infocenter/ramhelp/v7r2m0/topic/com.ibm.ram.doc/topics/t_use_custompolicy_api.html?resultof=%22%64%65%6d%6f%22%20%22%70%6f%6c%69%63%79%22%20%22%70%6f%6c%69%63%69%22%20

Regards... Peter

permanent link
Gili Mendel (1.8k56) | answered Apr 07 '10, 12:06 p.m.
JAZZ DEVELOPER
Hi there,
Is there any samples on how to do this: I need to run a policy inside asset1 and cicle among the related assets, checking the type of each asset. If a specific asset type is found I need to set a categorization on asset1.


If you write a policy, use the sample Governor that RAM ships
http://publib.boulder.ibm.com/infocenter/ramhelp/v7r2m0/topic/com.ibm.ram.doc/topics/t_use_custompolicy_api.html

It has java source in it, so you can play with the policy, and see the code.

If all you need is related assets, check out OddMinutePolicy policy. You can configure relationships (when you click on the configure link).
When the policy runs, you can


....
new RelationshipConfigurationDetails(key, "Relationships to include", "This is a list of relationships we want to include"),
......
RelatedAssetAccessor[] relatedAssets = (RelatedAssetAccessor[])getParameters().get(key);
....
relatedAssets[??].getManifestAccessor().getAssetTypeLocalized()

Your answer


Register or to post your answer.