0% found this document useful (0 votes)
9 views

Run OTA To Update Case Status

Uploaded by

A
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

Run OTA To Update Case Status

Uploaded by

A
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

Update Case Status from by running OTA

User Story: Configuring OTA for Status Update


As a system administrator, I want to configure a One-Time Activity (OTA) to
update the status of existing cases in our application. This is necessary
because sometimes there are sudden changes in requirements, and the client
has requested that we change the status for certain cases to a new status.
Acceptance Criteria:
➢ The activity should retrieve work objects’ statuses during OTA.
➢ The filtering criteria (parameters) for selecting work objects should be clearly
defined.
➢ The activity should handle exceptions and provide information about any work
objects that couldn’t be updated.
➢ Error work objects should not be included in subsequent executions.

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.

Choose the status case ID.

NOW Let’s change this by running OTA.

Like wise whatever cases are in the same status, I want to update all a time.

Create one activity.


maintain the parameters to map current status to new status.

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.

To trace it, keep the pagelist in the tracer.

Now run it by passing the parameters.


These many cases are present with this status.

Now let’s loop these results and update the status with new one.

Call the page list in the step page of loop.

Let’s call a new page, and open by handle by holding pzInsKey.

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.

Let’s assume that currently obj-open-by-Handle is opening on the page of “WorkData”.

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:

You have to think about negative scenarios also.

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:

Optional. Enter one of the following values:

Debug — Record as DEBUG severity, produces the largest number of messages; least severe.

Info — Record as INFO severity.


Warn — Record as WARN severity.

Error — Record as ERROR severity; most severe.

InfoForced — Always record as INFO event.

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.

*******************************************************************************

In this step the process will be mapped directly by label.

I am setting a log in the backend, to identify the issue when we debug.

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.

Log will be captured.


Now logs will be added to log files.

Configure → system → operations → Logs.

Log files → Pega Logs

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.

Always after this step, it will be move to PR labelled step.


In this way we can handle the exception scenarios.

Let’s go back to scenario, Now update the status by parameter new.

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.

Let’s run the OTA and check.

Let’s check the case.


Let’s check one of the work objects.

You might also like