1) CALL Schema.StatusOut (Inputroot.xmlnsc.status);
-- Translate Status For SOAP Response
CREATE PROCEDURE StatusOut (IN ParmIn CHARACTER)
RETURNS CHARACTER
BEGIN
CASE ParmIn
WHEN 'S' THEN
RETURN 'SUCCESS';
WHEN 'F' THEN
RETURN 'FAILURE';
WHEN 'P' THEN
RETURN 'PARTIAL';
END CASE;
END;
-- Translate SeverityLevel For SOAP Response
CREATE PROCEDURE SeverityLevelOut (IN ParmIn CHARACTER)
RETURNS CHARACTER
BEGIN
CASE ParmIn
WHEN 'S' THEN
RETURN 'CRITICAL';
WHEN 'E' THEN
RETURN 'ERROR';
WHEN 'W' THEN
RETURN 'WARNING';
WHEN 'I' THEN
RETURN 'INFORMATIONAL';
END CASE;
END;
-- Translate SeverityLevel To Status For SOAP Response
CREATE PROCEDURE SeverityLevelToStatusOut (IN ParmIn CHARACTER)
RETURNS CHARACTER
BEGIN
CASE ParmIn
WHEN 'S' THEN
RETURN 'FAILURE';
WHEN 'E' THEN
RETURN 'FAILURE';
WHEN 'W' THEN
RETURN 'SUCCESS';
WHEN 'I' THEN
RETURN 'SUCCESS';
ELSE
RETURN 'SUCCESS';
END CASE;
END;
2)
DECLARE inputref REFERENCE TO InputRoot.JSON.Hdr;
DECLARE outputref REFERENCE TO OutputRoot.SOAP.Hdr;
CALL TRReqHdr_JSONtoSOAP(inputref, outputref );
CREATE PROCEDURE TRReqHdr_JSONtoSOAP(IN InRef_trReqHdr REFERENCE, INOUT OutRef_TRReqHdr REFERENCE) BEGIN
------------
field level mapping
------------
END;
3) calling db/java procedures..
step1) create procedure in the esql module,
CREATE PROCEDURE DoSomething (IN in1 CHARACTER, OUT out1 CHARACTER, OUT out2 CHARACTER)
LANGUAGE DATABASE
EXTERNAL NAME "DoSomething";
step2) Now you can call this function from your ESQL main function as below:
CALL DoSomething(in,out1,out2) IN Database.yourschema.yourDB;