Get queue items by transaction progress

queueitem

#1

I want to get a list of items from a work queue filtered by their ‘transaction progress’ (not their ‘transaction status’). The purpose is: the queue items will have been worked by a previous automation. I want to then run a report on those items that have a status of ‘successful’ or ‘failed’, but which have not already been reported on.

Looking at the ‘Get Queue Items’ activity, it seems you cannot filter on ‘Transaction progress’, so I thought, okay, I’ll get all queue items with a status of ‘successful’ or ‘failed’ loop through them, read the transaction progress value and then get that transaction item to report on it. I cannot figure out how to do it though.

How do you read transaction progress from a ‘Queue Item’ object? I already made sure that my For Each loop has its TypeArguement set to UiPath.Orchestrator.Client.QueueItems.

Once I have verified that the queue item’s ‘Transaction Progress’ value is “ready to report”, how do I work with that item to report on it? Can I continue to use it as a Queue Item, or do I need to use Get Transaction Item and somehow identify the specific item I want so I can use it has a transaction Item?

or… Do I need to approach it completely differently and use 2 work queues, one for processing and one for reporting?

Any help would be much appreciated!


#2

@Foehl

You can Use Orchestrator API for getting Queue Items. In that You can give Progress Node in filter property .

Regards,
Mahesh


#3

Unless I’m misunderstanding… it seems like you’re on the right track.

Generally speaking… you can use Get Queue Items as you mentioned, loop through the resulting items, and if the current item in your loop has Item.Progress = “ready to report”, why not invoke a report.xaml workflow right then and there, and pass that QueueItem as an argument to it?

If you are averse to doing that for whatever reason, you could simply new up a List of QueueItem variable at the appropriate scope, and as you find a QueueItem having progress = “ready to report”, simply toss that item into that List of QueueItem variable, and once the loop is done, pass that List of QueueItem variable into some other reporting workflow.


#4

The issue I have is that once the status of the work item is changed to successful by the first automation, any information held in Item.Progress is lost, so I can’t carry it over to the reporting process.

I considered not updating the status of the items until after the reporting stage, but that feels wrong to me: The item has been completed from a processing point of view and I’m attempting to report on how many work items have been successfully completed or failed, so without updating the status, the report is a little redundant.

Right now I’m thinking the best way to do it is to create a batch record for each processing run: an external record (.xlsx file or maybe DB) which tracks all items processed and their reporting status and to use that as the input for the reporting process…


#5

Sorry for the delay.

Instead of relying on Item.Progress, which you say is vaporized after a status is set (which seems weird – I would think they could leave the final progress value in place)… I was thinking you could write an output field (i.e. ReportStatus=Ready or something) at the time you pass/fail the transaction and interrogate that for your reporting purposes.

I guess the problem there is… UiPath doesn’t allow us to add output values for a transaction that has failed. That has never felt right to me.


#6

Do you mean an output field in an external file; a field in the log or is this something associated directly with a transaction item?


#7

Transaction item (Queue Item) has an output property into which you could stash values during Set Transaction Status. I am thinking maybe you can use this field instead of the outcome value from “Set Transaction Progress”.

Only problem is, for some reason we are blocked from doing that if the transaction is deemed a failure.

In your case maybe it doesn’t matter since you’re only trying to query up and interact with items that are ready to report.

When you later Get Transaction Items and iterate through them, I’m thinking you can probably interrogate the output value to see whether it’s ready to report.