Key steps in this lesson
Add validation Action App to our project.
Configure process flow the way that if Agent fails to match Invoice and PO, an Action Center Task is created allowing Human to make a decision.
Based on App Action (Approve or Reject) direct flow further.
(Optional) Improve Agent's prompt to handle some edge cases.
In many cases where Agent can not determine exact course of action, Human involvement is required. Humans process task in Action Center using the conveniently summarized inputs from Robots/Agents:
all inputs required to make a decision should be presented on one screen: ideally we don't want business users to open applications or go back and review execution flow.
agent's job is to prepare all inputs in the right format, so that when time comes to ask user inputs, it's ready.
once decision is made - our Process execution continues to next steps.
Note: in real life, it is absolutely not ok to approve invoice and send it for payment, if purchase order was for something different; in some countries it's a crime. But for this practice we assume that humans can do whatever they want when it comes to this decision with no consequences.
Let's plan the Action's structure:
In short, we need a nice frontend for the user, where problem is presented along with necessary information to make a decision.
Our problem is that invoice and purchase order don't match, so both documents should be presented. Ideally we highlight in red specific items that require attention.
It's good idea to describe the problem to human with a couple of sentences, just in case.
If decision is to Reject Invoice and Send email to Supplier - we can help user with email draft so that even more time can be saved. Hmm, we already have it generated by Agent.
Do you think this kind of form will be helpful for a business user to speed up processing time? Any opportunity to improve it?
Let's build it!!! Well.. it will take a lot of time, so .. maybe let's just re-use existing App template instead. 😅
There is a shared template for the app which can be used.
Import existing project into your solution, find "2WM Validation App IXP Template" and click "Add".
After few seconds the App project will appear in your solution. This is important to understand key design considerations:
Structure of the App UI elements - this is how validation task appears in from of the user.
App Actions and Action Schema - this covers possible outcomes of the user decision or action.
App Inputs and Outputs: where data comes from, where it is used, what comes out.
Let's open Agentic Process again and configure the validation task as Action App Task:
Make sure to customize your Task Title, so that it's easier to identify your tasks in Action Center later.
In Advanced options, assign the task to yourself. Otherwise you will need to locate the task in a pool of all unassigned tasks.
App should pick the Agent's outputs as App inputs, just the way we did with agent. Here you might again see the true value of following naming conventions!
One last step in this lesson - let's configure the downstream flow based on validation decision:
Let's set "Reject" as default path (noting that real business business process might have different approach).
Then in Expression Editor pick "Action" output, which as per App settings can be "Approve" or "Reject".
Here is what we want:
Testing time! Now click on Debug button and monitor the execution. In some cases (in_FailureProbability), Invoice will not match the Purchase Order and will go for validation:
Processing was suspended and Maestro will wait until decision is made. Click "Open app task" link or find task in Action Center:
Looks like Agent did a fine job even though this invoice should not be rejected. As soon as task was processed, Maestro continues the execution:
Let's agree that the App could use a better design, but all in all - it does the job well enough.
Feel free to make couple of additional test runs, and move on to the next lesson. We are almost done!