IN my -process before adding the items into queue i have to check is there any items available in the queue with New, InProgress & Retried status
If it is there means i have to
“Change the status of queue items New, In-Progress & Retried to Failed before creating new batch”
Additional info : I am able to change the status from New to Failed but in-progress items i cant able able to change the status to failed
Can any one help me out.
First question: don’t you want unique queue items? If you set them to failed, then you can’t add them back again. But, if you don’t want unique queue items, then that’s ok.
Secondly, I think you might be mixed up here. It should not let you set New items to Failed because the item has not been processed yet. You have to Get Transaction Item to set it to In Progress first, then set to Failed. So, I’m confused as to why you can’t change In Progress to Failed. Or maybe I am remembering incorrectly, as I’m not at a machine with my workflow at the moment where I could double check what I did to manipulate the statuses.
Maybe if you can show some errors you are getting and a snippet of your workflow where you are trying to do this, we can help better.
i am not discussion about unique item.
2.I am able to change the status from new to failed and retried to failed
3.but i can’t able to change the status from in-progress to failed because in-progress item will be Abandoned after 24 hours
If Queue have already item with in-progress status i want to know is there any way to change the status from in-progress to failed before adding new items into queues
Have you tried this?:
Get Queue Items … in Properties choose “In Progress” (or all the ones you want to change to Failed)
Then use a ForEach to loop through those items. And, place a Set Status in the loop, so it changes each one to Failed.
Hope that helps. This is actually how I am doing it and just did it yesterday, so hopefully it works for you.
Also, check your permissions for the Robot role in Orchestrator. It should be able to create and edit Transactions.
Can you show an image of your activities that do this and their properties, or upload the snippet?
I’m not sure I know what’s wrong, because it works for me. Show any errors you are getting too.
below error message is getting while trying to change the status from in-progress to failed
“ExceptionDescription”: “Initialization Failed: Object reference not set to an instance of an object. at Source: System.Activities”
Ah, looks good but I think there might be a problem between the Get Transaction Item and Set transaction status. I’ll check my CleanQueue workflow I made to fix the Queue, but it will be a while. I’ll get back to you later, unless someone else mentions a solution for you.
“ExceptionDescription”: “Initialization Failed: Object reference not set to an instance of an object. at Source: System.Activities”
As for the error, you should figure out which variable is causing this. Like use QueueItems isNot Nothing in a Message Box after the Get Queue Items. Also, remove the Do While loop; it’s not needed and could be causing a problem.
Retried item status changing to failed
But again’ it is checking is tehre nay item with retired that time I am getting object reference is not Set to instance object error
I am not aware of there being a 100 limit, but if there is then I can understand why you would want a Do While. - Make sure your QueueItems variable is in a scope outside the loop though, or it will give you the “object reference is not set” error". Like I said in an earlier post, you would want to figure out which variable is causing this error because then you can identify the issue and where it occurs.
I created this versatile workflow to clean up the Queue the other week: CleanQueue.xaml (20.5 KB)
Feel free to look at it but is not quite finished cause I only have it coded to change In Progress, Failed, and Successful states - but the others can be added in the Switch. And read the annotations on the variables and sequences to understand how to use it correctly. I believe it is set up to change all In Progress to Failed as the variables are currently.
Essentially, you set an array of the states you want to change, and it loops through them and changes the status of each item in that state. Also, like I said, New items did not allow me to change to Failed because it needs to be as In Progress first. However, you said that isn’t the case for you, which I find weird.