WebServices After and Before Operation Rule (connectorStateMap)

I am working with WebService Before and After Operation Rule. I used the following source code to update the connectorStateMap.


Map updatedInfoMap = new HashMap();
Map connectorStateMap = new HashMap();
connectorStateMap.put("accessToken", “xyz” );
updatedInfoMap.put("connectorStateMap",connectorStateMap);
return updatedInfoMap;

I do see in the logs that i was successful in updating the ConnectorStateMap

{“stack”:“ccg”,“pod”:“stg01-useast1”,“connector-logging”:“144”,“Operation”:“TestConfiguration”,“clusterId”:“134”,“buildNumber”:“691”,“apiUsername”:“Pl6VsjiIPTknXJeo”,“orgType”:“staging”,“file”:“RequestOrchestratorV2.java”,“messageType”:“test-connection”,“connector-bundle-identityiq”:“165”,“line_number”:579,“@version”:1,“CB_version”:“428”,“logger_name”:“sailpoint.connector.webservices.v2.RequestOrchestratorV2”,“class”:“sailpoint.connector.webservices.v2.RequestOrchestratorV2”,“clientId”:“1006”,“request_milliseconds”:“858”,“source_host”:“ec2cda205b27”,“method”:“handleBeforeOperationRule”,“org”:“org-sb”,“level”:“DEBUG”,“IdentityIQ”:“8.0 Build c2de0cea2a-20211110-022835”,“message”:“Updated info map before operation rule post-processing: {connectorStateMap={accessToken=xyz}}”,“@timestamp”:“2022-04-26T17:22:54.381Z”,“thread_name”:“pool-5-thread-37”,“region”:“us-east-1”,“AppType”:“Web Services”,“Application”:“Beacon-WS [source]”,“request_id”:“67d09866dfcb4436a374bbe1b9b6f2bf”,“CB_Type”:“connector-bundle-webservices”,“queue”:“stg01-useast1-org-sb-cluster-134”,“SCIM Common”:“8.0 Build 00b1f252d1b-20200225-190809”}

My question is how do I retrieve the value “xyz” back from the connectorStateMap using another Rule… for example WebServiceBeforeOperationRule. Is the connectorStateMap accessible from the UI? i am pretty confused as to how to get this value back programmatically after populating it.

Help!

I had the same problem, I tried a bunch of different methods but am still unsure how to read from the connectorStateMap and couldn’t find it in any documentation.

I found a workaround for my case: you can set/get arbitrary attributes on the Endpoint object that’s available to both the WebServicesBeforeOperation & AfterOperation rules.

So in the BeforeOperation rule you can store something in an attribute:

requestEndPoint.setAttribute("someAttributeWeNeed", someValueWeCalculated);

…and as long as you return requestEndPoint at the end of your BeforeOperation rule (either by itself or in the map with the ‘updatedEndPoint’ key), you can retrieve them in the AfterOperation rule with this:

requestEndPoint.getAttribute("someAttributeWeNeed");

It’s not clear to me if that attribute is still on the Endpoint after the operation completes (i.e. is it available for future operations), but I don’t need it for any longer so this method works for me.