E9.2 Orchestrator Connector and bringing in values to use within an Orchestrator

notchy

notchy

Active Member
Hi everyone. I am hoping to get some assistance on this one.

I am on Tools Release: EnterpriseOne 9.2.6.1 and should be able to use under "Response" -> "Body" section to define my values and variables to be used.

1700086804207.png


I have my Connector setup correctly and it is pulling in the correct data with no issues viewing it when I click on "Test" It is an array with values coming in and I need 4 of the values to be passed in and used in the Orchestrator. When I click on Show Output. I get the output below. It is missing 2 out of the 4 defined outputs.

1700086994579.png




My issue I believe is that the 2 values that I need have a "." notation and is not being brought it correctly.
How can I fix this?

The other 2 values I can see within an Orchestration and use the values but missing the other 2 values.
 
Welcome to the wonderful world of response body mapping :D

You need to play until you figure it out, long story short.

When in doubt, just put the same var value in both columns of the body map. Start there. Move forward with fancy output var naming once you have everything working in the first place :)

The column headers are not very helpful IMO. I think they need to switch to things like "rest response var name" and "connector output var name"

Good luck!
 
Hi everyone. I am hoping to get some assistance on this one.

I am on Tools Release: EnterpriseOne 9.2.6.1 and should be able to use under "Response" -> "Body" section to define my values and variables to be used.

View attachment 19870


I have my Connector setup correctly and it is pulling in the correct data with no issues viewing it when I click on "Test" It is an array with values coming in and I need 4 of the values to be passed in and used in the Orchestrator. When I click on Show Output. I get the output below. It is missing 2 out of the 4 defined outputs.

View attachment 19871




My issue I believe is that the 2 values that I need have a "." notation and is not being brought it correctly.
How can I fix this?

The other 2 values I can see within an Orchestration and use the values but missing the other 2 values.
Can you post a screen shot with the raw json you receive back, prior to clicking the Show Output?
 
The issue is that the period in your keys is being interpreted as
Here is the json output received.
The issue has to do with periods in the key. The dot notation for defining output expects the period to indicate a lower level object. So, when you try to map this:
{
"result":[
{
"device.name":"string",
"position.satellites":"string",
"timestamp":"number",
"ident":"string"
}
]
}
Orchestrator is looking for this:
{
"result":[
{
"device":{"name":"string"},
"position":{"satellites":"string"},
"timestamp":"number",
"ident":"string"
}
]
}

One option to work around this is to write a little script in the manipulate body section to iterate through the result array and create a new array with the keys that do not have "." in them. For example,"device.name" could be renamed "device_name". You would then be able to map them correctly in your output.
 
The issue is that the period in your keys is being interpreted as

The issue has to do with periods in the key. The dot notation for defining output expects the period to indicate a lower level object. So, when you try to map this:
{
"result":[
{
"device.name":"string",
"position.satellites":"string",
"timestamp":"number",
"ident":"string"
}
]
}
Orchestrator is looking for this:
{
"result":[
{
"device":{"name":"string"},
"position":{"satellites":"string"},
"timestamp":"number",
"ident":"string"
}
]
}

One option to work around this is to write a little script in the manipulate body section to iterate through the result array and create a new array with the keys that do not have "." in them. For example,"device.name" could be renamed "device_name". You would then be able to map them correctly in your output.

Thanks @Kevin Long for the response. Any way you could give me an example of groovy scripting that I can follow to rename the keys?
 
It would look something like this. I haven't tested this, so your mileage may vary. However, it should get you going down the right path.

{
def jsonIn = new JsonSlurper().parseText(input);

// create a new object
newJson = new JsonSlurper().parseText('{"result":[]}')

// iterate through the original array
jsonIn.result.each {
// create a new object
result = new JsonSlurper().parseText("{}")

// set the new keys in the object to the values from the original array
result["device_name"]=it["device.name"]
result["position_satellites"]=it["position.satellites"]
result["timestamp"]=it["timestamp"]
result["ident"]=it["ident"]

// add the object to the new results array
newJson.result << result
}
// replace jsonIn with newJson object
//def jsonOut = new JsonBuilder(jsonIn).toString();
def jsonOut = new JsonBuilder(newJson).toString();
return jsonOut;
}
 
It would look something like this. I haven't tested this, so your mileage may vary. However, it should get you going down the right path.

{
def jsonIn = new JsonSlurper().parseText(input);

// create a new object
newJson = new JsonSlurper().parseText('{"result":[]}')

// iterate through the original array
jsonIn.result.each {
// create a new object
result = new JsonSlurper().parseText("{}")

// set the new keys in the object to the values from the original array
result["device_name"]=it["device.name"]
result["position_satellites"]=it["position.satellites"]
result["timestamp"]=it["timestamp"]
result["ident"]=it["ident"]

// add the object to the new results array
newJson.result << result
}
// replace jsonIn with newJson object
//def jsonOut = new JsonBuilder(jsonIn).toString();
def jsonOut = new JsonBuilder(newJson).toString();
return jsonOut;
}
Thank you @Kevin Long
 
@Kevin Long - have another question regarding accessing the renamed key "values" to do some logic on it in Orchestrator. I iterating over the array but I do not see the individual key fields to add some additional logic.

Example : I would want to see key "device_name" value which is "car" I would want to check if the value is equal to "car" and then do something conditional logic with it.

I only see the array output as an option but not the individual key.

I played with returnMap.put but I think I am using the incorrect syntax.
 

Attachments

  • Screenshot 2023-11-22 125645.jpg
    Screenshot 2023-11-22 125645.jpg
    39.6 KB · Views: 11
@Kevin Long - have another question regarding accessing the renamed key "values" to do some logic on it in Orchestrator. I iterating over the array but I do not see the individual key fields to add some additional logic.

Example : I would want to see key "device_name" value which is "car" I would want to check if the value is equal to "car" and then do something conditional logic with it.

I only see the array output as an option but not the individual key.

I played with returnMap.put but I think I am using the incorrect syntax.
Can you post screen shots of the output connector as well as the groovy in the Manipulate Output section?
 
here are the screenshot of the manipulate body of with the groovy script and the output.
 

Attachments

  • Manipulate Body Groovy Script 2023-11-22 132025.jpg
    Manipulate Body Groovy Script 2023-11-22 132025.jpg
    87.9 KB · Views: 29
  • Output 2023-11-22 132358.jpg
    Output 2023-11-22 132358.jpg
    19.6 KB · Views: 29
It is, but I’m hoping to see if there is anything in the Named Object column to the right of the Array toggle. I’m guessing it says OutputArray.
 
It is, but I’m hoping to see if there is anything in the Named Object column to the right of the Array toggle. I’m guessing it says OutputArray.
yes it is "OutputArray"
 

Attachments

  • Screenshot 2023-11-22 195444.jpg
    Screenshot 2023-11-22 195444.jpg
    21.2 KB · Views: 10
Remove the OutputArray from the Named Object column and the individual keys should become available in your transformation. Sorry, I should have asked about the Named Object column first.
 
Back
Top