REFramework for dispatcher separate with perfomer

Hi,

I’m new user of REFramework since some projects.

At the moment, I always designed dispatcher and performer in the same projet, because it was small processes. But I’ve now a process more complex with many many transaction to do.

I’ve read and a teacher said to me that use REFramework for all business projects was better.

I’ve search how to design my dispatcher with REFramework. I’m not so far of the solution I think… But I’ve somes questions.

I’ve seen in a Youtube video that GetTransactionData is not necessary. Transactions will be add in queue in ProcessTransaction workflow.

In GetTransactionData workflow, we can read :

Get a transaction item from the specified Orchestrator queue.
If queues are not used in this process, replace this activity with the appropriated logic to retrieve transaction items.
For example, if transactions are rows from a DataTable, the row corresponding to the current transaction is retrieved at this point.

Great. But how to do ? If all the REFramework is based on queue items, must I to create manually temporary TransactionItems here for each line of my Excel sheet for example, and create real Queue items in the ProcessTransaction workflow ? I try that and it’s not so bad, but I’ve many warnings because REFramework try to set status of theses transactions…

How do you do please ? I understand that create a simple Dispatcher without REFramework would be very easy… But is it a best practice ?..

In fact, my dispatcher is very simple. It consist on read Excel sheet and create transaction items (ie 100 per day), for the performer.

Hi @SA64

The Get Transaction Data workflow in the default REFramework is designed to fetch transactions from a queue. if you’re data coming from different source like excel then you can modify into get transaction data.

Read your Excel sheet or other data source in the init state and store it in a DataTable.
Change the type of TransactionItem in Main.xaml from QueueItem to DataRow.
in get transaction you can add logic if there are no rows to process then you can assign transaction item to nothing .

I hope This would help you!

1 Like

Hi @SA64,

you can use the approach as stated by @Akash_Javalekar1.

or you can also do below:

  1. Init state - read excel file, store in datatable. Then have a workflow created in to read from datatable and add items to queue.
  2. Get transaction state - get items from queue one by one.
  3. Process - add processing logic for those queue items.

If you want to create 2 parts dispatcher and Performer model.

For Dispatcher, i would just go with 2 states - Init and end process and remove rest of the states.
For Performer, will keep all states of re-framework and do like below:

  1. Init state- all init tasks
  2. Get txn data - get queue items
  3. Process - add the processing logic for those queue items
  4. end process - also add post processing tasks

I am also adding the below screenshot that helps you with the different courses available on UiPath academy:

If you don’t wish to go through academy course, you can just go through below re-framework documentation to understand its working in details:
REFramework documentation.pdf (507.8 KB)

Hope this helps.

Regards
Sonali

1 Like

@SA64

  1. If the dispatcher work is to read excel and add data to queue…then you can do this also in a single process and just give a input argument to main xaml to control if you want to run dispatcher or mot using a boolean argument. Now you have something called as add bulk queue items activity which will add all the data in datatatable to queue at once without iterating.
  2. If you still want to go with separate dispatcher then dont remove get transaction data …instead change transactionitem to datarow and in get transaction data remove get queue items and add a if condition to check in_transactionnumber <= io_transactiondata.Rows.Count and on then side use assign with out_transactionitem = io_transactiondata.Rows(in_transactionnumber-1) and on else side assign out_transactionitem = Nothing
  3. And read the data from excel into datatable in init state under if first run and assign to transactiondata variable

Cheers

1 Like

You could easily convert every process into a Dispatcher and Performer

if you are processing an excel file - You can add one queue item with file path only. No need to consider each row as transaction

This way - you can use RE framework without any change and most of the code will go to performer with proper exception and retry mechanism

1 Like

Thanks for all !

I’ve used the @Akash_Javalekar1 solution and parts of all your suggests.

Works fine, great ! So happy, I’ve create a modele. I’ve now a Dispatcher only based on REFramework.

3 Likes

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.