Query about Generate Yearly Reports Reframework-UiPath Academy

Hi All, in the UiPath professional automation developer course in the “practice reframework” module, there is a problem name-“Generate yearly reports” okay in that i need to know one thing that in the hints its written that :-


can some one please explain me the meaning of these two, and why we are doing this
would be of great help @supermanPunch @Palaniyappan or anyone?

Cheers

1 Like

Basically with that exercise you’re dealing with the process of generating yearly reports from a web application.

Let’s break down the instructions

  1. For the first one Edit Get Transaction Data XAML:

In the “Get Transaction Data” part of the REFramework, you’re responsible for getting individual transactions to process. This hint is suggesting that you should modify the “Get Transaction Data” workflow (XAML) as

Delete Retry Get Transaction Item Activity:

You should remove the “Retry Get Transaction Item” activity. This is because you don’t want to keep retrying if a transaction is not available. Instead, you want to determine whether a transaction is available or not.

Use an Element Exists Activity:

To check whether there is a page number UI element on the work item page that corresponds to the current transaction number. If such an element exists, it means a transaction is available. If not, it means the transaction is not available.

Assign Transaction Number:

If the element exists, you assign the transaction number to out_transactionitem. If not, you assign zero to out_transactionitem. This is how you manage and identify the availability of transactions.

Why to do

This is done because the work item page may not exist for all transaction numbers. For example, if a transaction has already been processed, then the work item page for that transaction may be deleted. In this case, we want to skip processing the transaction.

  1. For second point
    Edit Process.xaml Workflow:

Once you’ve determined that a transaction is available, you need to process it. This part of the hint suggests that you modify the “Process.xaml” workflow as

Determine If the Browser Is on the Work Item Page:

You should check whether the web browser is on the work item page indicated by the transaction item. This step ensures that you’re working with the right page before proceeding with scraping data.

Scrape Data and Filter by Type:

If the browser is on the work item page, you should then scrape the data from that page. This data might include information about a report. After scraping, you should filter the data by type (e.g., yearly report) and process it accordingly.

Add to Corresponding Queue Items:

Based on the filtered data, you should add corresponding queue items for further processing. For example, you might add a queue item for each yearly report that needs to be generated.

why to do

This is done because we only want to scrape the data for the current transaction. If the browser is not on the work item page for the current transaction, then we want to skip processing the transaction.

These modifications are meant to ensure that the automation process works efficiently and that you’re correctly handling transactions, which can vary in availability and content.

Hope it’s clarified

Cheers @Jai_Pande

Okay basically in get transaction detail the workflow is preparing the data table for the process state like if the table page is not in match with the current transaction right??

1 Like

Your understanding is correct. In the “Get Transaction Data” workflow, you are preparing the DataTable for the Process state. This involves checking if the page matches the current transaction.

The main purpose of the “Get Transaction Data” state in the REFramework is to retrieve individual transactions and prepare the data that will be processed in the “Process Transaction” state.

So, the modification suggested in the hint is to optimize the process by skipping unnecessary transactions that don’t have a corresponding page. This ensures that you only process transactions that are relevant to the task, improving the efficiency of your automation.

Hope this clarifies

Cheers @Jai_Pande

Okay and we are not using this condition “in_transaction item <= io_dt_transaction_data” because its a dispatcher and will be run only once right then we can use add bulk to add in to orchestrator for the perfomer? Am i right brother? Also please check your linkedin have texted you

Thanks man!

1 Like

Yes
In the context of the Dispatcher part of the REFramework, the goal is to retrieve all the transactions from a source (e.g., an Excel file or a queue) and prepare them to be processed. Since the Dispatcher is responsible for loading all available transactions, there’s no need for the condition “in_transaction item <= io_dt_transaction_data” in this part.

This condition is typically used in the Performer part of the REFramework, where each transaction is processed one at a time. In the Performer, this condition ensures that the processing continues as long as there are more transactions to process, and it stops when all transactions have been processed

@Jai_Pande

Totally got it brother! I just need to know how to think of that logic in the dispatcher process

1 Like

pseudocode

# Dispatcher pseudocode

# Get all transactions from the source
transactions = get_transactions_from_source()

# Prepare each transaction for processing
for transaction in transactions:
    # Check if the transaction is available
    if transaction_is_available():
        # Add the transaction to the queue
        add_transaction_to_queue(transaction)

# Start the Performer process
start_performer_process()

This pseudocode describes the following steps:

  1. Get all transactions from the source.
  2. Prepare each transaction for processing by checking if it is available and adding it to the queue if it is.
  3. Start the Performer process.

The Performer process will then process each transaction in the queue one at a time.

The key point here is that the Dispatcher does not need to keep track of which transactions have already been processed, because the Performer will do that. The Dispatcher’s job is simply to get all transactions from the source and prepare them for processing.

Hope this helps

Cheers @Jai_Pande

ok one more query, here he is using the invoke to WI items workflow which will be processed once but after that what is the need for element exist activity to check whether the transaction is at Work items page 1 or not, if we go to work items page by default it opens 1st page brother

1 Like

This is basically done to check whether it’s in right page or not before proceeding further
@Jai_Pande

Okay i get it but when we open work items page brother its in page 1 only

U mean it has to go for next page or has to be page 1 only @Jai_Pande

No no, like when we open work items page…it is by default at page 1 only

1 Like

Cool then element exists is just to confirm that @Jai_Pande

Okay brother…and can i use add bulk items to queue activity to add tran items to queue…actually see sometime in page 1 we dont have that exact work item id for instance its wi4 for that generate yearly report…so what should i should add bulk or add queue item

1 Like

Basically to add bulk add queue item we need to have a datatable created
So any data u fetch add it a datatable having all the fields held in queue item and then pass it to BULK ADD QUEUE item activity
https://docs.uipath.com/activities/other/latest/workflow/bulk-add-queue-items

If u have any value pass it with add Datarow to datatable
If it doesn’t have value pass string.empty to datatable using same add Datarow

@Jai_Pande

i am really having a bit of difficulty can you kindly check my workflow, would be of great help man plus when i am using add bulk items its not adding anything to the queue maybe because in page 1 there is no WI4 items?


Practice-REF-Generate Yearly Report-Dispatcher.zip (1.3 MB)

Will suggest a simple step
Use table extraction to get this in a datatable and use filters as u want
Then u can pass that to bulk add queue item activity
Make sure u have columns that are there as a field in queue items
@Jai_Pande

okay but i want to do it from reframework as it will contribute to my learning brother :), did you saw workflow that i designed

and one more thing, here he is using the transaction item as a page number(string/int32) but why bro? like transaction item should be the datarow right becasue we are using framework without queues

REFramework without Queue Items Checklist.pdf (589.5 KB)