Run OTA To Update Case Status
Run OTA To Update Case Status
Solution:
Creating generic OTA (One time run activity) to update Work Object status from current status to
New Status.
Before we proceed, make sure we have few Work Object created with Some status and available in
DB.
Like wise whatever cases are in the same status, I want to update all a time.
Now I want to browse all the work objects which should pick my paramerized values.
Lets say “Pending-fulfilment” if I provide while running it should pick those status work objects only.
Before that keep the page list in the pages and classes. To hold the return values.
If I run and test, you can find out the results.
Now let’s loop these results and update the status with new one.
To update the status, we need a page right, so that’s the reason create a temporary page in
clipboard.
IN Loop we are going to pick each record one by one.
CaseData.pxResults(<CURRENT>).pzInsKey
Note: in this way mentioned above we have to take based on the situation.
It is not opening on the context of loop page, so that’s why specifically mentioned to take from the
results of WOList.
If we don’t mention the temp page on the step page, then we can directly pass pzInsKey, because
if step page is empty it takes from the parent step.
Directly also we can mention the key in the obj-open-by handle so don’t confuse.
CURRENT Key word identified, current page Index value, on which the step is looping.
Exception handline scenario:
Have to handle while opening if any case fails, that is called exceptional handling.
you can use jump condition for this, while opening if any case fails I am mapping the case to other
steps, which should not process with the current steps.
Log-Messages: Parameters
Message: Enter the text of the message between double quotes, or an expression that results in a
text value.
LoggingLevel:
Debug — Record as DEBUG severity, produces the largest number of messages; least severe.
GenerateStackTrace
Select to cause execution of this method to create a Java stack trace in the Pega log, in addition to
other results. If the SendToTracer check box is selected, the stack trace also appears in the Tracer
tool output.
SendToTracer
Select to cause a Tracer event when this method executes, in addition to other results.
*******************************************************************************
Failure scenarios happen possibility is like, while opening a case we are acquiring a lock right, so if
the case if opened by some other operator.
So that case will be locked by himself, at the same time when you are trying to open the same key, it
will be failed because of locking issues.
Remember while tracing keep the log-message enable.
If it a happy path, then this flow step should not execute right, so it makes it, we have to skip this
step before reaching to here.
Once the case got committed then we have to make jump to other steps, where when = always.
And save it in the backend table by Doing commit. By doing commit this data will committed in
backend and as well case lock will be released.
For best practice we can use other method “CommitwitherrorHandling” also. Which handles the
error scenario’s as well like if any lock release fails, or any commit issues.
Which will release lock and if any error occurs while saving, it will roll back the case aswell.
…………………………………………………………………………………………………………………………………………….
Once we are done with the update, remove the page and page list.