origam.com

Work queue classes mapped to entity - how to add an extra non-entity-mapped column

Is it possible to add a non-mapped column to a work queue class if it is mapped to an entity (‘entity’ field is not empty).
E.g. I want to see ‘RecordCreated’ of the actual work queue entry and not the mapped entity. How to model that?

According to

it should add all columns that have a column mapping and then it adds extra 3 system columns.

What you can do is to map a date column (e.g. d1). Add the following XPath expression to the column mapping to generate a system date: date:date-time(). This will fill the d1 column (that you should alias in the work queue class’s data structure) with a system date.

I thought the ‘input mapping’ is used only when the system creates/updates the work queue entry from an input (either connected entity, or context store passed into WorkQueueService::add() method). And for the purpose of displaying columns it uses the Work Queue data structure.
I was investigating the current functionality further and if I tried to removed a ‘RecordCreated’ from ‘input mappings’, then the WorkQueueEntry.RecordCreated db field was automatically set during the creation. However, when I set input mapping to (/row/@RecordCreated) it kept updating from connected entity record. If I added /row/RecordCreated input mapping (without ‘@’), it didn’t show the data, but set the RecordCreated db field correctly (as if the mapping for RecordCreated doesn’t exist at all)
Your advice with adding date:date-time() to input mapping wouldn’t work. It would update each time the connected entity is updated. I tested it and it worked that way. So you can’t capture RecordCreated that way.

I would personally change the behavior, so that RecordCreated (and maybe RecordUpdated) is added all the time to the list of the display fields. And I would disallow input mappings targeting to that columns.

I have a customer’s request to show RecordCreated at work queue entries. It looks like I need to wait/implement such a functionality, or it may work when I would convert WorkQueueClass to disconnected one, but not sure about it.

I think adding the queue’s RecordCreated column to all queue screens is a good idea.