Unable to set Queue Item status

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.

Hello @SWATI_KAROT,

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 :

  1. Ensure you add unique reference to every queue item
  2. Run ‘Get Queue Items’
  3. Loop over the Queue Items.
  4. 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’

Hope that helps ! Kudos :slight_smile:

Regards,
Nithin

3 Likes

All you need is something like this:

Hello @bcorrea,

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:

image

Regards,
Nithin

1 Like

Yes, set transaction only have successful or failed, so i must imagine one already have the items started before trying to set its status…

Hello @bcorrea,

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.

Regards,
Nithin

That is what i meant, i dont know what is the real use there… Maybe that process wants to set an already processed queue…

1 Like

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?

Hello @SWATI_KAROT,

Check the TypeArgument on the For Each:

Regards,
Nithin

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?

Hello @SWATI_KAROT,

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.

Regards,
Nithin

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.

Adding the screenshot from Orchestrator.

Hello @SWATI_KAROT,

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.

Regards,
Nithin

Yeah, I am thinking so too. Let me figure out some other way of doing this.
Thank you for your time.

1 Like