How to pass specific Queue Item to a workflow

I’m trying to understand Queues.

As I understand it you first fetch the Queue Items by Status using Get Queue Items activity. This returns a List of queue items. Now, let’s say I want to filter this list further and only send certain transactions into another workflow to be processed.

Now for my processing workflow. I know that if you use Get Transaction Item, it automatically changes the transaction to “In Progress” which would be a good thing. But how to pass the specific Item I want work on to that activity? There is no parameter that accepts a QueueItem object. It seems it goes back to Orchestrator and just gets the next Item in the queue.

I tried to set the Transaction Status directly but it doesn’t give me the option of setting it to “In Progress”, only “Successful” or “Failed”. Why would we be limited in this way?

Is there a way to fetch only the desired Queue Item? Failing that, can we just set the transaction of an item in the list to “In Progress” directly?

@Terry_Marr

one way you can acheive this is by giving unique reference for each item

in get transaction item you have filter on reference so can pass the reference you need to the activity to get specific queue item

cheers

Can you give me an example? I tried to pass in the QItem variable to my workflow, and set the Reference parameter as QItem.Reference. But it errors saying Object reference not set to an instance of the object.

@Terry_Marr

Where did you try to pass?

as per error looks like Qitem is empty or the reference is empty

cheers

In Get Transaction Item there a property called “Reference”. In there I put QItem (my incoming QueueItem variable) and Reference, like so

QItem.Reference

Now I notice that my Queue looks like this, and Reference field is empty:

Is that why it’s failing? I added these records via Bulk Add Queue Items from a spreadsheet (actually a datatable variable). Is there a way to automatically add something to that field?

@Terry_Marr

Yes …create a new column Reference and any unique value…like if you have an invoice id column or ao…or anything else…instead of adding as specific content can add as reference only so can change the column name to Reference…else as said create new and add same data as unique data to this column also

Cheers

Wait. Do you mean add Reference column when creating the Queue up in Orchestrator? Or do you mean adding a new column to the DataTable variable and calling it “Reference”, and filling it up with some unique value? This seems like a lot of trouble to just fetch a specific DataItem from the Queue. So here’s what I’m trying:

DISPATCHER:

  1. Read Excel to datatable
  2. Copy datatable schema to new datatable and add Reference Field that auto-increments
  3. Now load original data into new data table
  4. Now bulk insert this datatable into Queue

PERFORMER:

  1. Get Queue Items (gets list of new)
  2. Grab the QueueItem you want and pass to:

PERFORMER WORKFLOW per transaction: (QItem as argument)

  1. Use Get Transaction Item activity - Set Reference to QItem.Reference

It fails here: Get Transaction Item: Object reference not set to an instance of an object.

@Terry_Marr

May be the old items still exist…please delete them or remove them from get queue items

Object ref not set will come only when variable is null or reference is null…run in debug check the locals panel to confirm

cheers

Thank you for that. I see my error now. First off, I have to make sure I’m setting my Get Transaction Item reference to the argument coming in. In my case it was inQItem. Then the Reference property works. I also have to set the output of that activity to a new variable, say currentItem, in order to pass it to the Set Transaction Status activity.

So apparently, having a QueueItem in memory isn’t enough to establish a link to the Queue? You have to use Get Transaction Item and use that to set status to “In Progress” or later to Successful or Failed.

Seems like a lot of trouble to just work with one Queue Item.

Hi @Terry_Marr ,
The reference property works as a filter. In the GetTransactionData state machine, use as a filter the reference you need; example if you need queue items where the reference is = 5, then pass the value in the property; it means that the performer will only grab those items and will keep the rest of the items as New. Stronger references naming convention, the better.

@Terry_Marr

The requirement you have defines what you need to do

Cheers