Hello, I am not able to set the status of queue Item with ‘Set Transaction Status’ activity.
Please find below screenshot. Please help me understand what am I missing here.
Although, when i use ‘Add to queue’ → ‘Get Transaction Item’ → ‘Set Transaction status’, I am able to set the status.
But ‘Get Queue Item’ → ‘Get Transaction Item’ → ‘Set Transaction status’, I am not able to set the status.
The best way to loop over all the existing items in queue is to use the REFramework. That said for you case:
Try these steps :
Ensure you add unique reference to every queue item
Run ‘Get Queue Items’
Loop over the Queue Items.
Inside the loop when you do a ‘Get Transaction Item’ , in the Reference Section of the Properties pass “item.Reference” and then pass the obtained transaction item to ‘Set Transaction Status’
In theory this solution should work. But, to Set the Transaction Status the Queue Item must first be moved to “In Progress” from “New” state else you will get the below error:
That would mean ‘Get Transaction Item’ must be run before you can do a ‘Set Transaction Item’. We can’t run ‘Get Queue Items’ → ‘Set Transaction Status’ like you mentioned.
Hi @Nithin_P, Thanks for your response. I included a reference to each queue item while adding the queue items to the queue. But when i try to pass item.Reference in property of Get transaction Item activity, no such option is showing up.
Please find the below screeshot.
Hi @bcorrea, Thank you for your reply. I tried the way you suggested i.e. passing the queue item in ‘Set transaction Item’ activity. But it looks for a transaction item and not a queue Item. It gives me below error as shown in screenshot.
Hi @bcorrea, Just to clarify the use case here. I have a process say Process1 (processes a PDF file) and a queue called ExceptionQueue. When Process1 completes execution and there is any kind of exception, then that particular file is moved to this ExceptionQueue with status as ‘Failed’.
Now I have a queue trigger, where if more than 5 files accumulate in the ExceptionQueue, then run Process1 again.
Now my scenario here is, after the queue trigger has triggered the Process1 and processed all files in ExceptionQueue, i want to set the queue item status to ‘Successful’, since the processing is completed.
Now how do i set the status from Failed to Successful in this case?
Hi @Nithin_P, thanks again for your valuable time, I did set the For Each TypeArgument to the one you have mentioned. I am still getting error ‘Set Transaction Status: Object reference not set to an instance of an object.’
Please see screenshot below. Do I need to do any other modifications?
This means the Get Transaction Item is not returning any queue item, could you please check if queue items exisits for a particular reference in “New” state in the queue you are using.
When I am adding it to the Queue, I am marking it as ‘Failed’ status, because it is an exception queue (hold list of all files that failed to process).
Hence, yes the queue Item is not in ‘New’ status it is in ‘failed’ status. And now I want to set it to ‘Successful’ status.
We cannot change the status of queue item from Failed to Successful. You can pick the failed item, create a new queue item and then follow the procedure I mentioned earlier.