cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Target aggregation rule

Target aggregation rule

Find the acctNativeIdentity in application schema:

2020-08-30_16-29-45.png

 

Run the rule in Debug:

 

 

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE sailpoint PUBLIC "sailpoint.dtd" "sailpoint.dtd">
<sailpoint><Rule language="beanshell" name="Target-Aggregation">
  <Source><![CDATA[
 	    import sailpoint.object.Application;
 	    import sailpoint.object.Attributes;
 	    import sailpoint.object.ResourceObject;
 	    import sailpoint.object.TaskResult;
 	    import sailpoint.api.Aggregator;
 	    import sailpoint.connector.Connector;
		
		/*
		 * Provide the appName and acctNativeIdentity below and run the rule in Debug
		 */
		String appName = "";
		String acctNativeIdentity = "";
		
		Application appObject = context.getObjectByName(Application.class, appName);
		String appConnName = appObject.getConnector();
	    Connector appConnector = sailpoint.connector.ConnectorFactory.getConnector(appObject, null);
	   	ResourceObject rObj = appConnector.getObject("account", acctNativeIdentity, null);
		
   	 	if(rObj!=null) {
 	 		Attributes argMap = new Attributes();
 	 		argMap.put("aggregationType", "account");
 	 		argMap.put("applications", appName);
 	 		argMap.put("descriptionAttribute","description");
 	 		argMap.put("descriptionLocale", "en_US");
 	 		argMap.put("noOptimizeReaggregation", "true");
 	 		Aggregator agg = new Aggregator(context, argMap);
 	 		TaskResult result = agg.aggregate(appObject,rObj);
  	 		return rObj.toXml();
 	 	} else {
 	 		return "The account: " + acctNativeIdentity + " can not be found.";
    	}

  ]]></Source>
</Rule>

 

Labels (1)
Version history
Revision #:
6 of 6
Last update:
‎May 16, 2026 10:42 AM
Updated by: