Child Process Flow activity: PC_PF_SubmitBill_SubProcess_API
Implementation
This Child Process sends the bill to ADVA for Pricing.
When ResponseCode is 200 we send the billJSON sent by the client to ADVA through ASB for Pricing.
Process Flow Activity
Initially, we create the default flow.
At the start of the event, Gateway
 Defines two flows. We create a default flow.
Â
The default condition will only execute when the responseCode is not 200
A Gateway controls the divergence and convergence of a sequence flow. Thus, it determines the branching, forking, merging, and joining of paths.
We create a data mapping to fetch the error backend status.
Create a JSON Layout: This JSON layout contains API Backend Status
Create a Custom Plugin: This Custom plugin is removing \ from JSON data.
Script:
import org.apache.commons.io.IOUtils;
String json = IOUtils.toString(inputStream);
json = json.replaceAll("\\\\", " ").replaceAll("\t", " ").trim().replaceAll("\"\\{", "{").replaceAll("}\\\"", "}");
service.write(json.toString().getBytes(), "default");
Create a Rest Consumer: This Rest Consumer is created for Backend Status.
Create a Context Target:
Implementation
Process Flow Activity
At the start of the event, Gateway Defines two flows. Now we create a subsequent flow.
Create Context Source: To Get response data in restRequest.
Create a JSON Schema: This Layout is created to parse JSON data.
Create Data Mapping: We create this Data Mapping to handle mandatory and process request
Create Custom Plugin: It basically converts the XML to JSON and cleans it to optimize the end JSON.
|
---|
Create Custom Plugin: We create this Custom Plugin for Backend Status in API sub process.
Â