E9.2 How to make an AIS Orch Call always return "output": [ ... ] even in Error

JohnDanter2

JohnDanter2

VIP Member
Hi folks

I want to know if it is possible to send back the output componet part "output": [ ... ] of the JSON response when an E1 BSFN encounters an error

Example of success
{
"ServiceRequest1": {
"name": "GetUDC",
"template": "D0005",
"submitted": true,
"result": {
"output": [
{
"id": 7,
"value": "Capitalized Lease",
"name": "szDescription001"
},
{
"id": 8,
"value": " ",
"name": "szDescription002"
},
{
"id": 9,
"value": " ",
"name": "szSpecialHandlingCode"
},
{
"id": 14,
"value": " ",
"name": "szErrorMessageId"
}
]
}
},
"jde__status": "SUCCESS",
"jde__startTimestamp": "2022-10-20T05:05:55.888-0500",
"jde__endTimestamp": "2022-10-20T05:05:56.172-0500",
"jde__serverExecutionSeconds": 0.284
}

Example of error
{
"message": {
"X0005_BSFNCall": {
"szerror": "0027",
"errorLevel": 1,
"alphaDescription": "Error: User Defined Code Error",
"glossaryText": "CAUSE . . . . The entered code was not found in the User Defined Codes.\nRESOLUTION. . Enter a valid code or place the cursor in the field in error\n and press 'F1' to display the valid values for the field.\n",
"fileName": "rtk_udvl.c",
"lineNumber": 597
}
},
"exception": "Exception",
"timeStamp": "2022-10-20T05:11:44.053-0500",
"userDefinedErrorText": "",
"jde__simpleMessage": "X0005_BSFNCall failed: Error: User Defined Code Error",
"jde__status": "ERROR",
"jde__startTimestamp": "2022-10-20T05:11:43.790-0500",
"jde__endTimestamp": "2022-10-20T05:11:44.056-0500",
"jde__serverExecutionSeconds": 0.266,
"status": "ERROR"
}


I would love the reponse, error or not to still include the "output": [ .. ] part.
I have seen we can send back simple message, so maybe I can amend the JSON response part to add the inputs????

Thanks

John
 
I was running into more or less this EXACT thing with a REST call yesterday. It looks like there's some "hard coded" error conditions in the service call that causes orchestrator to fire off a hard error and just abandon anything returned.

In my case I ended up setting up the "Return Raw Output" option, and then the next step after that is to test the raw output of the call if blank (continue on error option set of course). If blank, then the error has fired and we can action based on that.

1666273827099.png
I'd love to see what Larry or Gustavo do in these situations.
 
Thanks!
I'll fiddle about tomorrow and see.
This issue bugged me in BSSV calls too, so I don't want a repeat :) I want the E1 BSFN parameter outputs in the reponse. XML Call object does it fine
 
With the method I found, you could return the success call contents to a scripting component and then just parse the return in there. Do the same if error, but hardcode the result you're looking for. Then use the return of the scripting component as a 100% solution in your orchestration.

I don't see a way to get at the contents of the error message except to pass it on to an error handling orchestration or notification which seems to be just an outbound dataflow-- I can't find a place to return the error message to the main line of the orchestration. It's maddening. Maybe solved in R22 or 23 which we're not yet on
 
I may play with the messages tab. You can add variables to the return message adn I am getting back DTAI in my UDC call. but not the rest (no pun intended)

Error Message is ON then

Error Response is '200003'
DESC1 = ${szDescription001}
DESC2 = ${szDescription002}
SPHD = ${szSpecialHandlingCode}
DTAI = ${szErrorMessageId}

See if I can add them as a variable. Or even the JSON manipulation tab.
Bit odd they dont' down allow this , so I suspect they must do somewhere as it's E1 tech
 
I'm hosting a couple of things next week at InFocus with Clayton I'll try to pick his brain a bit on this. Might end up being an enhancement request
 
Update on this
I have a simple Orch over X0005 to play around with and prototpye desired respones.

If you click the BSFN step in your Orch, then click the right ! for error handling, we can add the following to the top part that says 'User Defined Error Text' we can type in the following (for example)

SY = ${szSystemCode} RT = ${szRecordTypeCode} KY = ${szUserDefinedCode} Error code = ${szErrorMessageId}

So all variables are entered as ${variable}

Then your error response then adds an extra line called "userDefinedErrorText": and looks like this

"userDefinedErrorText": "SY = '12' RT = 'FM' KY = 'X' Error code = 0027"

So here I added the 3 inputs and then the output error
 
Hi all

Anyone have any ideas on this? As in an ideal world I know the .NET team in my company will just want the output: [ ] to be the same in both success and error states.
I maybe worrying over nothing, I just want to make thier lives easier :)

So anyone got any bright ideas on it?

Thanks

John
 
I'm hosting a couple of things next week at InFocus with Clayton I'll try to pick his brain a bit on this. Might end up being an enhancement request
Hi Dave

Did you pick his brains on this? As it's one reason I hate BSSVs too lol. Whilst it looks like we can tailor the repsonses for success warning and error, it would be good if no matter what, it just sent back the outputs.
 
g into more or less this EXACT thing with a REST call yesterday. It looks like there's some "hard coded" error conditions in the service call that causes orchestrator to fire off a hard error and just abandon anything
und, you could return the success call contents to a scripting component and then just parse the return in there. Do the same if error, but hardcode the result you're looking for. Then use the return of the scripting component as a
d love the reponse, error or not to still include the "o
Hi folks

I want to know if it is possible to send back the output componet part "output": [ ... ] of the JSON response when an E1 BSFN encounters an error

Example of success
{
"ServiceRequest1": {
"name": "GetUDC",
"template": "D0005",
"submitted": true,
"result": {
"output": [
{
"id": 7,
"value": "Capitalized Lease",
"name": "szDescription001"
},
{
"id": 8,
"value": " ",
"name": "szDescription002"
},
{
"id": 9,
"value": " ",
"name": "szSpecialHandlingCode"
},
{
"id": 14,
"value": " ",
"name": "szErrorMessageId"
}
]
}
},
"jde__status": "SUCCESS",
"jde__startTimestamp": "2022-10-20T05:05:55.888-0500",
"jde__endTimestamp": "2022-10-20T05:05:56.172-0500",
"jde__serverExecutionSeconds": 0.284
}

Example of error
{
"message": {
"X0005_BSFNCall": {
"szerror": "0027",
"errorLevel": 1,
"alphaDescription": "Error: User Defined Code Error",
"glossaryText": "CAUSE . . . . The entered code was not found in the User Defined Codes.\nRESOLUTION. . Enter a valid code or place the cursor in the field in error\n and press 'F1' to display the valid values for the field.\n",
"fileName": "rtk_udvl.c",
"lineNumber": 597
}
},
"exception": "Exception",
"timeStamp": "2022-10-20T05:11:44.053-0500",
"userDefinedErrorText": "",
"jde__simpleMessage": "X0005_BSFNCall failed: Error: User Defined Code Error",
"jde__status": "ERROR",
"jde__startTimestamp": "2022-10-20T05:11:43.790-0500",
"jde__endTimestamp": "2022-10-20T05:11:44.056-0500",
"jde__serverExecutionSeconds": 0.266,
"status": "ERROR"
}


I would love the reponse, error or not to still include the "output": [ .. ] part.
I have seen we can send back simple message, so maybe I can amend the JSON response part to add the inputs????

Thanks

John
Can't you just use the "Continue" exception option and use the "Manipulate Outputs" on the Orchestration End step to snip out or substitute the parts you don't want?
 
Can't you just use the "Continue" exception option and use the "Manipulate Outputs" on the Orchestration End step to snip out or substitute the parts you don't want?

I'm sure I could...if it works. I think I did try this but may have done it wrong :)

I'm just asking what do people do in this situation and how they handle it and that the consumer is happy. But yes I can play around, thanks :)
 
Hi Dave

Did you pick his brains on this? As it's one reason I hate BSSVs too lol. Whilst it looks like we can tailor the repsonses for success warning and error, it would be good if no matter what, it just sent back the outputs.
@JohnDanter2 , I hadn't seen this reply from before sorry about that! Let me go back and check my notes-- I definitely chatted with many people about almost everything during conference :D I think it's safe in the meantime to toss in an enhancement request if you haven't come to a reasonable resolution http://cloudnnf.questoraclecommunity.org/questenhancementtool/dashboard.aspx
 
I'm sure I could...if it works. I think I did try this but may have done it wrong :)

I'm just asking what do people do in this situation and how they handle it and that the consumer is happy. But yes I can play around, thanks :)

OK, well you can add in a "Manipulate Outputs" script if you want to do this at the return of the Orchestration, or a Custom Groovy request if you want to override the output somewhere in the middle. As I understand it, you want your Orchestration to simply return an empty equivalent when the BSFN gets an exception. All you need to do is set the BSFN step's Error Handling option to continue on error, and use the Orchestration's "Manipulate Outputs" script to check the output, and if an error, substitute a fake blank output - see the example below.

NB: if you want the szErrorMessageId error code returned, you would need to pick it out from the jsonIn and concatenate it into the jsonOut string.

import groovy.json.JsonSlurper;
import groovy.json.JsonBuilder;
import com.oracle.e1.common.OrchestrationAttributes;
String main(OrchestrationAttributes orchAttr, String input)
{
def jsonIn = new JsonSlurper().parseText(input);
// default output is the same as the input
def jsonOut = input;

// Check the JSON for a "continuedOnError" element
if (jsonIn.continuedOnError) {
// there was an Exception - fake up the blank output
jsonOut = '''{
"ServiceRequest1": {
"name": "GetUDC",
"template": "D0005",
"submitted": true,
"result": {
"output": [
{
"id": 7,
"value": " ",
"name": "szDescription001"
},
{
"id": 8,
"value": " ",
"name": "szDescription002"
},
{
"id": 9,
"value": " ",
"name": "szSpecialHandlingCode"
},
{
"id": 14,
"value": " ", // <--- could insert the actual szerror text here
"name": "szErrorMessageId"
}
]
}
}
}'''
}

return jsonOut;
}
 
Last edited:
Q: how do you post code that looks like what you entered? All the indentation disappears!
 
NB: if you want the szErrorMessageId error code returned, you would need to pick it out from the jsonIn and concatenate it into the jsonOut string.

Love it, many thanks mate. I'll try this later today and see how I get on.
As for your question to me on pasting, I don't know :) sometimes I move text to word as an intermediate step for things like that
 
Q: how do you post code that looks like what you entered? All the indentation disappears!
Use the Code button, here's a form request i happen to be looking at. You can choose the language for coloring as well
1670856455808.png

XML:
<?xml version='1.0' encoding='UTF-8'?>
<ServiceRequest>
  <omwObjectName>SRE_2212050003JDE</omwObjectName>
  <studioVersion>9.2.5.6</studioVersion>
  <name>HC_FR_P54HS00_AddClaimant</name>
  <shortDesc>This is to add the claimant person 54HS|RL code 33 to a H&amp;S Incident. Code here will be rolled into main claims code FR</shortDesc>
  <productCode>55</productCode>
  <locale>en</locale>
  <updateTime>1670623948436</updateTime>
  <description></description>
  <group>0</group>
  <appStack>true</appStack>
  <returnFromAllForms>true</returnFromAllForms>
  <bypassER>false</bypassER>
  <serviceRequestSteps>
    <serviceRequestSteps type="formRequest" appOID="P54HS00_W54HS00B" version="ZJDE0001" bypassFormServiceEREvent="true">
      <formTitle>Add Incident</formTitle>
      <formActions>
        <formActions type="input">
          <input>Incident_Description</input>
          <mappedTo>67</mappedTo>
          <action>SetControlValue</action>
          <title>Incident Description</title>
        </formActions>
        <formActions type="detail">
          <inputGrid>GridData</inputGrid>
          <mappedTo>49_33</mappedTo>
          <rowData>
            <rowData>
              <input>Person_Name</input>
              <mappedTo>36</mappedTo>
              <action>SetGridCellValue</action>
            </rowData>
            <rowData>
              <input>Incident_Role</input>
              <mappedTo>37</mappedTo>
              <action>SetGridCellValue</action>
            </rowData>
          </rowData>
        </formActions>
        <formActions type="input">
          <input>Incident_Date___Time</input>
          <mappedTo>57</mappedTo>
          <action>SetControlValue</action>
          <title>Incident Date / Time</title>
        </formActions>
        <formActions type="input">
          <input>Business_Unit</input>
          <mappedTo>52_30</mappedTo>
          <action>SetControlValue</action>
          <title>Business Unit</title>
        </formActions>
      </formActions>
      <stopOnWarning>false</stopOnWarning>
      <maxPageSize>0</maxPageSize>
      <pageSize>1000</pageSize>
      <outputType>GRID_DATA</outputType>
      <turboMode></turboMode>
      <enableAsyncEvents>true</enableAsyncEvents>
      <queryObjectName></queryObjectName>
      <allowCache>false</allowCache>
      <forceUpdate>false</forceUpdate>
      <cacheTime>0</cacheTime>
      <bypassER>false</bypassER>
    </serviceRequestSteps>
  </serviceRequestSteps>
</ServiceRequest>
 
Back
Top