Difference between revisions of "I2Rest PCML syntax"

From i2Rest
Jump to: navigation, search
Line 2: Line 2:
  
 
== Additional PCML data tags ==
 
== Additional PCML data tags ==
Three more attributes in [Https://www.ibm.com/support/knowledgecenter/en/ssw_ibm_i_74/rzahh/pcmldttg.htm PCML data tag] - trimarray, assert, exclude. attributes was added in order to improve response processing on server side.<br>
+
Three more attributes in [Https://www.ibm.com/support/knowledgecenter/en/ssw_ibm_i_74/rzahh/pcmldttg.htm PCML data tag] were added in order to improve response processing on server side.<br>
 
trimarray - specifies the path to programm, that should handle array been passed in current <data> element.
 
trimarray - specifies the path to programm, that should handle array been passed in current <data> element.
 
<pre> <data name="CCY"    type="char"  length="3" trimarray="/qsys.lib/%libl%.lib/jpcmlt_bl.pgm"/></pre>
 
<pre> <data name="CCY"    type="char"  length="3" trimarray="/qsys.lib/%libl%.lib/jpcmlt_bl.pgm"/></pre>
 
jpcmlt_bl -  
 
jpcmlt_bl -  
 +
Custom array
  
assert - specifies the path to programm, that should handle some way data passed in current <data> element. As example
+
assert - specifies the path to programm, that should handle some way data passed in current <data> element.  
 
<code><pre> <data name="ERMSG"      type="struct" usage="output"      struct="KSM" assert="/qsys.lib/%libl%.lib/jpcmla_eq.pgm" exclude="true"/> </pre></code>
 
<code><pre> <data name="ERMSG"      type="struct" usage="output"      struct="KSM" assert="/qsys.lib/%libl%.lib/jpcmla_eq.pgm" exclude="true"/> </pre></code>
jpcmla_eq - is the program that comes in the package with i2Rest Server. It examine data in ERMSG element and, if KSM or errormessage is found, . When PCML parser recieve flag from jpcmla_eq it stops handling PCML tags. That prevents possible failures, which could occur if incorrect data was transferred with such response.
+
In the example above programm jpcmla_eq is used to process in ERMSG element. jpcmla_eq comes in the package with i2Rest Server.  
  
 +
  input:
 +
      pointer on record to be processed
 +
      record length
 +
  output:
 +
      error code 
 +
 +
It examine data in ERMSG element and, if KSM or errormessage is found, . When PCML parser recieve flag from jpcmla_eq it stops handling PCML tags. That prevents possible failures, which could occur if incorrect data was transferred with such response.
 
exclude - attribute applicable for <code>usage="output"</code> or <code>usage="inputoutput"</code> elements. Elements with exclude attribute will be not included into server response.
 
exclude - attribute applicable for <code>usage="output"</code> or <code>usage="inputoutput"</code> elements. Elements with exclude attribute will be not included into server response.
  

Revision as of 13:27, 12 May 2020


Additional PCML data tags

Three more attributes in PCML data tag were added in order to improve response processing on server side.
trimarray - specifies the path to programm, that should handle array been passed in current element.

 <data name="CCY"    type="char"  length="3" trimarray="/qsys.lib/%libl%.lib/jpcmlt_bl.pgm"/>

jpcmlt_bl - Custom array

assert - specifies the path to programm, that should handle some way data passed in current element.

 <data name="ERMSG"       type="struct" usage="output"      struct="KSM" assert="/qsys.lib/%libl%.lib/jpcmla_eq.pgm" exclude="true"/> 

In the example above programm jpcmla_eq is used to process in ERMSG element. jpcmla_eq comes in the package with i2Rest Server.

 input:
     pointer on record to be processed
     record length
 output:
     error code  

It examine data in ERMSG element and, if KSM or errormessage is found, . When PCML parser recieve flag from jpcmla_eq it stops handling PCML tags. That prevents possible failures, which could occur if incorrect data was transferred with such response. exclude - attribute applicable for usage="output" or usage="inputoutput" elements. Elements with exclude attribute will be not included into server response.

Open Api 3.0 tag

This tag is not about processing of remote program call like native PCML tags. It contains API description according to OpenAPI Specification (OAS), which allows both humans and computers to discover and understand the capabilities of the service without access to source code or documentation. An OpenAPI definition can then be used by documentation generation tools to display the API, code generation tools to generate servers and clients in various programming languages, testing tools, and many other use cases.