Routing logic in CPI:
${property.AppTaskID.trim().length()} = '0'
This blog is created to throw some lights on SAP CPI concepts, which experienced in my journey. Trying to explore more about HCI/Cloud platform integration/SCPI and sharing the contents to help you. Thanks for all Users your support. Please give your comments below ...
Routing logic in CPI:
${property.AppTaskID.trim().length()} = '0'
When connecting with SCP to pull the users using the API management.
Get the bearer token using the client key and secret and pass that to get the user details.
First call: To get the bearer token
{
"Resources": [
{
"id": "C5200000",
"meta": {
"created": "2020-09-18T13:02:33.628Z",
"lastModified":
"2020-09-18T13:02:33.628Z",
"location": "https://apissecurity.hana.ondemand.com/authorization/v1/platform/accounts/a79a6ea10/Users/C5200000"
},
"schemas": [
"urn:sap:cloud:scim:schemas:extension:custom:2.0:UserExt",
"urn:ietf:params:scim:schemas:core:2.0:User"
],
"userName": "C5200000",
"name": {
"familyName": "C",
"givenName": "ramu"
},
"emails": [
{
"value": "ramu@gmail.com",
"primary": true
}
],
"roles": [
{
"value": "AccountAdministrator",
"primary": false,
"type": "Predefined"
}
],
"urn:sap:cloud:scim:schemas:extension:custom:2.0:UserExt": {
"userbase": "xxCOM",
"description":
"SAP API Management team"
}
}
When getting an error calling the target system as below:
Error: Invalid parametertype used at function 'ge'
Date format to be changed from
((CHANGED_DT ge'2020-08-10T00:00:00') and (CHANGED_DT le'2020-09-22T00:00:00'))
to
((CHANGED_DT ge datetime'2020-08-10T00:00:00') and (CHANGED_DT le datetime'2020-09-22T00:00:00'))
Hope this works!!!
It is simple to remove the double quotes from the json data for the individual values. Earlier we used to pull the value in xpath and convert that value to interger to remove the double quotes.
But it makes more easier.
Groovy Script:
import com.sap.gateway.ip.core.customdev.util.Message;