Groovy - Data push and Smart push support for (E)PBCS - Part 2 Data Push

Hi folks,

In my previous post, I demonstrated how to perform Smart push through groovy rule. Now its time for Data Push. Smart push is a planner activity whereas Data push is a admin activity so this can only be used by a user who is admin.


2. Push data by executing groovy push

//Data map name
sDataMap = 'DataPush_BSO_ASO'

//Check where data map exists additional step can be ignored if not required
if(operation.application.hasDataMap(sDataMap)){
//Execute the data map (False - indicate data not to be cleared in target, True - indicates data to be cleared on target)
    operation.application.getDataMap(sDataMap).execute(false)
}



Another variant
//Data map name
sDataMap = 'DataPush_BSO_ASO'

String sDepartment = 'ILvl0Descendants(D0000)' //Functions supported only are those which are available at the data maps

//Check where data map exists additional step can be ignored if not required
if(operation.application.hasDataMap(sDataMap)){
//Execute the data map (False - indicate data not to be cleared in target, True - indicates data to be cleared on target)
//override values provided for department
    operation.application.getDataMap(sDataMap).execute("Department":sDepartment, false)
}


Additionally if you want to have other functions supported by Planning like @UDA, @Descendants in the override values of Data Map or Smart push, you can have one hidden variable with values for example @UDA(Department, "IT")

//RTPS: {vDepartment}
//Data map name
sDataMap = 'DataPush_BSO_ASO'

String sDepartment = rtps.vDepartment //will hold all the departments with UDA "IT" hack used by one of my team mate Sameer Karte :)

//Check where data map exists additional step can be ignored if not required
if(operation.application.hasDataMap(sDataMap)){
//Execute the data map (False - indicate data not to be cleared in target, True - indicates data to be cleared on target)
//override values provided for department
    operation.application.getDataMap(sDataMap).execute("Department":sDepartment, false)
}

Hope you enjoyed.

Cheers
--

Comments