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.
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 .
Init state - read excel file, store in datatable. Then have a workflow created in to read from datatable and add items to queue.
Get transaction state - get items from queue one by one.
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:
Init state- all init tasks
Get txn data - get queue items
Process - add the processing logic for those queue items
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)
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.
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
And read the data from excel into datatable in init state under if first run and assign to transactiondata variable