How to covert json to queue item?

How to covert json to queue item? Can someone throw some light on this?

@rshanthi

You can use Add Queue Item to load the Queue item. There you can give the DataType of Queue item as Jobj, if you parsed it to Jobject.

Regards,
Mahesh

Hi @MAHESH1,

Thanks for your response.

However, I guess this will not help in my case. I do not want an item to be added to the queue. Let me put forth my requirement in detail first.

I have n items in a queue. But during processing it should pick a particular item based on the reference and not on the normal FIFO way. I run an API query on the orchestrator to get the item with the specific reference… I get the json data.

Now I need to change this json into queueitem datatype and assign it to out_TransactionItem so that this specific item is processed first.

@rshanthi

Oh K , sorry I don’t have idea to convert Json to QueueItem datatype.

But I can give you one suggestion.

You are telling that you are trying API query on the Orchestrator to get the Queueitem Based Specific reference, If you know the specific reference to get the data, then why can’t you filter it before adding the data into Queue. So You can directly get it as a Queue Item.

Regards,
Mahesh

The reason is… my queue creation job will run every one hour and hence even if I go ahead by the suggestion, it will become a problem when new items are added later on

Thanks for your response @MAHESH1

Regards,
RShanthi

@rshanthi

What I am saying means before adding to queue Just check one condition,Even though Queue Creation job will run for every hour, how it will affect. You have to load into Queue after that only you can access right, So Whenever you Queue Creation job runs, it will check the required condition before adding it to Queue.

Regards,
Mahesh.

1 Like

@MAHESH1

I get you. But I dont have the guarantee that my second job will process all the items in the queue in one hour’s time. Maybe there will be some NEW items still there when the queue creation job runs the next time. I am not sure about the volume at this point in time. Hence these kind of approaches.

My current approach is to add “postpone transaction item” to push back the ones that should not be processed when they are picked up, to the queue again with New status. There will be a bit overhead for sure. Will confirm how it goes.

Thanks,
RShanthi

@rshanthi

Oh K, can you try by deserializing Json which you got by API into Queue Item. Then try that Queue Item.

Regards,
Mahesh

If the root cause of the problem is that you need all items in the queue to be processed in less than 1 hour (which is the time taken by the first process that adds new items) then you just need to add another robot (s) to process the queue items. That way you can process everything before the queue is fed again.

I have processes that need 10 robots to consume all the items in a queue that is fed every 15 minutes. And it works.