Stank1964
Well Known Member
in the interest of sharing with the group here.
Deepak over at the Oracle help line shared this with me from development. He said they will not support it and I have not gotten it to work yet, but here is the code....
import com.oracle.e1.common.OrchestrationAttributes;
import com.oracle.e1.aisclient.*;
import com.oracle.e1.aisclient.runbsfn.*;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;
HashMap<String, Object> main(OrchestrationAttributes orchAttr, HashMap inputMap)
{
HashMap<String, Object> returnMap = new HashMap<String, Object>();
String ais_url = (String)inputMap.get("ais_url");
LoginEnvironment loginEnv = new LoginEnvironment(ais_url, "JDE", "JDE", null);
if (loginEnv != null) {
try {
String abNo = (String)inputMap.get("abNo");
BSFNRequest bsfnRequest = new BSFNRequest(loginEnv);
bsfnRequest.setName("F0101GetAddressInformation");
bsfnRequest.setIsAsynch(false);
// Set Input Values
bsfnRequest.getInParams().add(new DSTRInputValue(1, abNo));
// Set Return Ids
bsfnRequest.getOutputIds().add(new Long(3));
bsfnRequest.getOutputIds().add(new Long(4));
BSFNResponse responseObject = bsfnRequest.execute();
if (responseObject.getResult().getErrors() != null) {
BSFNError errorValue = responseObject.getResult().getErrors().get(0);
String error = errorValue.getFileName() + " - " + errorValue.getLineNumber() + " - " + errorValue.getGlossaryText();
returnMap.put("error", error);
} else {
String outValue1 = responseObject.getResult().getOutput().get(0).getValue().toString();
returnMap.put("outValue1", outValue1);
String outValue2 = responseObject.getResult().getOutput().get(1).getValue().toString();
returnMap.put("outValue2", outValue2);
}
} catch (Exception e) {
String error = e.getMessage();
returnMap.put("error", error);
}
finally {
AISClientUtilities.logout(loginEnv);
}
}
return returnMap;
}
Deepak over at the Oracle help line shared this with me from development. He said they will not support it and I have not gotten it to work yet, but here is the code....
import com.oracle.e1.common.OrchestrationAttributes;
import com.oracle.e1.aisclient.*;
import com.oracle.e1.aisclient.runbsfn.*;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;
HashMap<String, Object> main(OrchestrationAttributes orchAttr, HashMap inputMap)
{
HashMap<String, Object> returnMap = new HashMap<String, Object>();
String ais_url = (String)inputMap.get("ais_url");
LoginEnvironment loginEnv = new LoginEnvironment(ais_url, "JDE", "JDE", null);
if (loginEnv != null) {
try {
String abNo = (String)inputMap.get("abNo");
BSFNRequest bsfnRequest = new BSFNRequest(loginEnv);
bsfnRequest.setName("F0101GetAddressInformation");
bsfnRequest.setIsAsynch(false);
// Set Input Values
bsfnRequest.getInParams().add(new DSTRInputValue(1, abNo));
// Set Return Ids
bsfnRequest.getOutputIds().add(new Long(3));
bsfnRequest.getOutputIds().add(new Long(4));
BSFNResponse responseObject = bsfnRequest.execute();
if (responseObject.getResult().getErrors() != null) {
BSFNError errorValue = responseObject.getResult().getErrors().get(0);
String error = errorValue.getFileName() + " - " + errorValue.getLineNumber() + " - " + errorValue.getGlossaryText();
returnMap.put("error", error);
} else {
String outValue1 = responseObject.getResult().getOutput().get(0).getValue().toString();
returnMap.put("outValue1", outValue1);
String outValue2 = responseObject.getResult().getOutput().get(1).getValue().toString();
returnMap.put("outValue2", outValue2);
}
} catch (Exception e) {
String error = e.getMessage();
returnMap.put("error", error);
}
finally {
AISClientUtilities.logout(loginEnv);
}
}
return returnMap;
}