I tried using transactionitem.status command inside set transaction status, but it’s giving the output as “Failed” even when it’s setting the item in queue as “Retried”.
Is there a way to get this status from orchestrator?
It will give the final status of the queue item and in this case its ‘Failed’. Do you want to check if a particular queue item was retried ? If that’s the case, have you tried TransactionItem.RetryNo?
Hi, I ran the work item and it threw an application exception, so in orchestrator it was set as “Retried” (retry count in queue is 1, so it’ll retry again) from set transaction status. Inside that I tried getting the status of the work item.
Then it started retrying again. Now instead of this failed message, is there a way to get the work item status (Retried) from the orchestrator? Also retry Number will be changed from retry count 3 or retry count 1 in queue sometimes, so it’s not a constant.
In the set transaction status activity, you have given the status as failed that’s why it get returned as failed. Use get transaction item after that and get the status.
Now, I have to do some tasks at the 3rd step, (i.e. Failed), but the set transaction status is setting the status as failed in the studio (even in case of 1st and 2nd retry).
Using Get Transaction Item will make the work item “In Progress” and then logging TransactionItem.Status will also give “InProgress”. So instead of fetching the work item status, it’ll make it as “InProgress”
So as you do not know the max retry here you have two options
use Orchestrator api request to get the queue definition and from that you get the max retry for queue /odata/QueueDefinitions
Store it in asset because only when you create a queue you can set the value so if you are changing change the asset and read it
Now from transactionitem.ReteyNo you will get the current retry number compare it with the max to know if it is the final transaction or if it would be retried
Hope this helps.Let me know if you have any issues