I wish to customise the Pega to interact with our internal system, by calling the API.
This is what we have implemented:
1) Output campaign data into OFFER Table in the database
2) An agent pick up the records in OFFER table in the database and call the API to insert records, and then update the status back.
In the agent, it is done in a piece of java code in (2) above, i) creating the database connection, ii) retrieve the records to be push, iii) update the status back to the table.
I am wondering, can I break down the codes and make use of the Pega steps so that the maintenance will be easier?
Thanks, finally you responded after such a long wait.
I am not sure what sort of implementation you are look for. I have no issue in the first portion of the process described above. And YES, the "OFFER" table is map as a class in Pega.
Attached is the Agent setup for the step (2) above, and below is the Step 1 of the Agent.
In summary, this long step will
1) connect to the database,
2) retrieve records from the "OFFER" table
3) Format the list of parameter for calling API
4) Call the API (get authentication ticket and then call the API)
5) Retrieve the result from API,
6) Connect to database again
7) update the status back to database for the record.
8) Zip the error file for sending in email
The other steps are sending emails.
My question are:
A) Is there any way of breaking down the long steps in Step 1 of the Agent?
B) If yes, how shall I achieve it? Please provide concrete example, as I am still a noob in Pega and Java.
C) For sending email, is there any method/code (whatever you call it), that will build up the email, instead of calling so many steps to build up the email?