Announcing the Saviynt Knowledge Exchange unifying the Saviynt forums, documentation, training,
and more in a single search tool across platforms. Read the announcement here.

callCondition not working

RoniYla
New Contributor
New Contributor

Hi,

I am working on a new implementation where we are doing multiple calls and we don't want to run all the calls every time a new updateaccountask is created.

So tried using the callCondition parameter to skip the the second call when its not needed.

First I tried this where it would compare the companyname to LegalEmployerName and if they are different it would complete the call as then the companyname was changed in Saviynt to something it is not in the endpoint.
"callCondition": "${response.call1.message.items[0].LegalEmployerName != user.companyname}",

This however failed and I also tested:
"callCondition": "${user.companyname != null}",

lastly I also tested this just to check if the functionality is broken as this would fail for the testusers every time as these field are populated.
"callCondition": "${account.customproperty4 == null && account.customproperty31 == null}",

{
    "accountIdPath": "call1.message.PersonNumber",
    "dateFormat": "yyyy-MM-dd'T'HH:mm:ssXXX",
    "responseColsToPropsMap": {
    "customproperty2": "call1.message.items[0].LegalEntityId~#~char",
    "customproperty3": "call1.message.items[0].assignments[0].BusinessUnitId~#~char",
    "customproperty4": "call1.message.items[0].assignments[0].AssignmentId~#~char",
    "customproperty5": "call1.message.items[0].assignments[0].AssignmentNumber~#~char",
    "customproperty6": "call1.message.items[0].assignments[0].AssignmentName~#~char",
    "customproperty7": "call1.message.items[0].assignments[0].BusinessUnitName~#~char",
    "customproperty8": "call1.message.items[0].LegalEmployerName~#~char",
    "customproperty11": "call1.message.items[0].PeriodOfServiceId~#~char",
    "customproperty43": "call1.message.items[0].links[0].href~#~char"
  },
    "call": [
                {
            "name": "call1",
            "callOrder": 0,
            "stageNumber": 0,
            "connection": "acctAuth",
            "url": "${account.customproperty31}/child/workRelationships?q=TerminationDate%20is%20null&expand=assignments,assignments.managers",
            "httpMethod": "GET",
            "httpParams": "",
            "httpHeaders": {
                "Authorization": "${access_token}",
                "Content-Type": "application/vnd.oracle.adf.action+json"
            },
            "httpContentType": "application/json",
            "successResponses": {
                "statusCode": [
                    200,
                    201
                ]
            }
        },
        {
            "name": "call2",
            "callOrder": 1,
            "stageNumber": 1,
            "connection": "acctAuth",
            "url": "${response.call1.message.items[0].links[0].href}/action/changeLegalEmployer",
            "httpMethod": "POST",
            "httpParams": "{\"actionCode\":\"GLB_TRANSFER\", \"effectiveDate\":\"${(new Date()).format('yyyy-MM-dd')}\",\"legalEntityId\":\"${if(user.companyname.equals(''Sub Company 1')){300000001376086} else if(user.companyname.equals(''Sub Company 2')){300000001376118} else if(user.companyname.equals('Sub Company 3')){300000017275553} else if(user.companyname.equals(''Sub Company 4')){300000001375132}}\",\"businessUnitId\":\"${if(user.companyname.equals(''Sub Company 1')){300000001370646} else if(user.companyname.equals(''Sub Company 3')){300000001370636} else if(user.companyname.equals(''Sub Company 4')){300000017306415} else if(user.companyname.equals(''Sub Company 5')){300000001370666}}\",\"copyAssignmentFlag\":true,\"sourceAssignmentId\":\"${account.customproperty4}\",\"sourceAssignmentNumber\":\"${account.customproperty5}\"}",
            "httpHeaders": {
                "Authorization": "${access_token}",
                "Content-Type": "application/vnd.oracle.adf.action+json"
            },
            "httpContentType": "application/json",
            "callCondition": "${account.customproperty4 == null && account.customproperty31 == null}",
            "successResponses": {
                "statusCode": [
                    200,
                    201
                ]
            }
        }
    ]
}

Task fails as the call2 fails even tough it shouldn't be run at all?

 

"call2":{"headers":{"X-Content-Type-Options":"nosniff","X-ORACLE-DMS-ECID":"005zEShT3kHFc5_LtQl3iX00066V00001z","Connection":"close","X-ORACLE-DMS-RID":"0:5","Date":"Tue, 30 May 2023 11:05:14 GMT","AKGRN":"0.144f655f.1685444713.12f9a3a3","Referrer-Policy":"origin","Strict-Transport-Security":"max-age=31536000; includeSubDomains","Cache-Control":"no-cache, no-store, must-revalidate","ETag":"\"ACED0005737200136A6176612E7574696C2E41727261794C6973747881D21D99C7619D03000149000473697A65787000000001770400000001737200116A6176612E6C616E672E496E746567657212E2A0A4F781873802000149000576616C7565787200106A6176612E6C616E672E4E756D62657286AC951D0B94E08B02000078700000000178\"","Vary":"Accept-Encoding","X-XSS-Protection":"1; mode=block","Content-Language":"en","Content-Type":"application/vnd.oracle.adf.actionresult+json","Location":"","REST-Framework-Version":"1"},"message":{"responseMessage":"You can't change the legal employer on or before the start date of the work relationship. (PER-1532311)"},"statusCode":400,"description":null,"status":"Failed"}}

Is this functionality broken or have I missed something?

br,

Roni Ylärakkola

8 REPLIES 8

SB
Saviynt Employee
Saviynt Employee

Below is the link to the REST Connector guide. You can refer the same for JSON construction example. I believe there is another parameter (callListPath) that you need to define in the  JSON.

https://docs.saviyntcloud.com/bundle/REST-v23x/page/Content/Developers-Handbook.htm


Regards,
Sahil

RoniYla
New Contributor
New Contributor

Hi,

I tested this in our own partner instance that is on v23.3 with the UppdateaccountJSON:

{
"accountIdPath": "call1.message.id",
"responseColsToPropsMap":
{
},
"call":
[
{
"name": "call1",
"connection": "userAuth",
"url": "https://webhook.site/17a88a2d-d64d-4b32-860a-ff53c6feca0e",
"httpMethod": "POST",
"callCondition": "${user.customproperty63 == null}",
"httpContentType": "application/json",
"httpParams": "",
"httpHeaders": {
"Content-Type": "application/json"
},
"successResponses": {
"statusCode": [200]
},
"unsuccessResponses": {
"statusCode": [400,401,403,409,500]
}
}
]
}

Looking at the task, it stayed on pending state even after provisioning job was run twice as the call wasn't triggered.

RoniYla_0-1685699169694.png

After I changed "callCondition": "${user.customproperty63 != null}",
The task was run successfully:

RoniYla_1-1685699437655.png

Webhook was updated with a POST request:

Request Details


POSThttps://webhook.site/17a88a2d-d64d-4b32-860a-ff53c6feca0e
Host52.51.117.70 whois
Date06/02/2023 12:47:16 PM (a few seconds ago)
Size370 bytes
IDce0ed3df-185b-4106-ba11-9a18a07f3238
Files
Headers
connectionclose
accept-encodinggzip,deflate
user-agentApache-HttpClient/4.5.3 (Java/1.8.0_372)
hostwebhook.site
content-length370
authorization
content-typeapplication/json
{
  "users": [
    {
      "employeeId": "121321421421",
      "active": true,
      "fullName": "Tommitester1 Tommitester1",
      "username": "test@test",
      "email": "example@example.com",
      "hireDate": "20220428",
      "terminationDate": "20220506",
      "jobTitle": "Tester",
      "team": "Team (12345)",
      "lineOfBusiness": "Tech",
      "areasOfInterest": [
        "Leder",
        "Tech",
        "Test Test"
      ],
      "nickName": "Tommitester1 Tommitester1",
      "userType": "REPORT"
    }
  ]
}

Now using the same configuration in our customers DEV environment the task get completed regardless of the configuration, even though the customproperty63 is populated.
This makes me believe the functionality is broken in our customers environment:
"callCondition": "${user.customproperty63 == null}",

RoniYla_2-1685699707072.png

 

SB
Saviynt Employee
Saviynt Employee

Did you add callListPath parameter in your latest JSON and then validate. Can you share the logs where we see the condition being evaluated and still moving to 2nd call.


Regards,
Sahil

RoniYla
New Contributor
New Contributor

Hey,

yes I have configured callListPath in customers DEV environment, even though it isn't necessary for this functionality based on testing in our partner instance.

Below is a log snippet from our internal test instance where the call is stopped. This log snippet cant be found in the customer DEV instance even though the configs are exactly the same so it seems as if the functionality is broken in the 5.5x.

Customer instance logs can't be shared here as this is a public forum.

"callCondition": "${response.call1.message.items[0].LegalEntityId == user.companyname}",
"callListPath": "response.call1.message.items[0].LegalEntityId",

{"log":"2023-06-02 09:43:41,695 [quartzScheduler_Worker-6] DEBUG rest.RestProvisioningService - skipping callName - call1 due to false callCondition\n","stream":"stdout","time":"2023-06-02T09:43:41.696031739Z"}

I seem to be experiencing the same issue in version 5.5, did you guys ever confirm this is a break?

Thanks

There is a similar post for this where the user wanted to make the 2nd call based on the response of the 1st call. Please refer to the below link for the same to see if it helps resolve your issue.

https://forums.saviynt.com/t5/identity-governance/make-second-call-depending-on-call1-response-messa...


Regards,
Sahil

JoshuaLawrence
New Contributor III
New Contributor III

This worked, thankyou

SB
Saviynt Employee
Saviynt Employee

Can you share the complete log for this provisioning call once. Do ensure to update ConfigJSON param in the REST connection with value {"showLogs":true} if not done already before running the job.


Regards,
Sahil