i
Pre/Post
When starting the modeler for a rule that uses the “Rest” type adapter, the area displayed is Pre/Post WS, and for a “JDBC” type rule is Pre/Post SQL.
Two required initial methods must be coded:
•protected void beforeExecutionRule() throws java.lang.Exception{}
It allows adding logic before the ApiRest service call or the JDBC invocation.
Example: An object can be read using the Deyel SDK and the result used as an input parameter in the JDBC invocation.
•protected void afterExecutionRule() throws java.lang.Exception{}
It allows adding logic after the ApiRest service call or the JDBC invocation.
Example: The result of the JDBC invocation can be received, processed, and saved in a form.
Additionally, in the “Rest” type rule, the following methods can be invoked:
Before Execution (beforeExecutionRule) |
After Execution (afterExecutionRule) |
---|---|
setBody(String body): Allows defining the body parameter of the request. |
String getBodyResponse(): Allows to get the response body. |
addHeader(String key, String value): Allows adding a heading to the request. |
Integer getHTTPStatus():Allows to get the HTTP state of the response. |
addQueryParam(String key, String value): Allows adding a parameter show to the request. |
List getHeadersResponse (); It allows obtaining a header list of the HTTP request executed. This list consists of objects of org.apache.http. header type. |
addValueToURL(String key, String value): Replaces the text specified in the first parameter with the value of the second parameter in the url of the service to be called. |
|