K2 Workflow lookup row data via ID/Key


Badge +1

What we’re trying to accomplish is:

 

  1. Create an editable list.
  2. The list should contain a Picker control for looking up parts from our datasource.
  3. Upon resolving a part, a number of other related fields should be populated.
  4. The user should be able to provide a quantity for each part.
  5. Upon completion of editing the list, only the relevant pieces of information should be stored to the SmartBox (PART_KEY and the user provided Quantity).
  6. The other fields (including part number and description) should not be stored to the SmartBox.
  7. Upon re-entering the form, the list should repopulate with the saved rows and all associated lookup data.

 

I have most of this functionality working: requirements 1 through 6 are all implemented and working fine. 

 

However, we cannot get requirement 7 to work. By using a editable list view the "list displays" take forever to pulll back data. 

 

We attempted a debug message prints the values from both the Table itself and the Add/Edit row:

 

We’re putting the data into all three sets of fields, only the Add/Edit row (and the not-shown Display Row field, it was tested previously) fields actually contain the data.

 

I have a feeling that the list only displays the values that are in the smartbox  object, which is why they aren’t showing up in the list. But, I also have no idea how to get them into that record since what we’re doing should be doing it.

 

When the user hits Edit on the row it resolves perfectly using the read method on the object for the row at great speed. We were able to publish this for each row to a message box however not to the row on the list.

 

There are obviously work-arounds for this:

 

  • We could store the other data in the SmartBox. This would be a waste of space and isn’t really the “right” way to do it.
  • We could make a composite SmartObject in K2 studio that looks up all information across the different database servers. I tested this and was able to get it to work, however, the composite SmartObject is “dumb” and doesn’t optimize its join. It just pulls back every row from  SmartBox table and every row in the Data Warehouse PARTS table and joins them in-memory. This is obscenely slow.

 

Either way, we’d like to do this the “right” way, but are unsure how to continue. From our perspective, the “right” way is to only store the relevant information and just lookup the rest on-demand, so we would like to continue down that route instead of using a work-around if possible.

 

 

Let me know what you think and what options we have.


2 replies

Userlevel 1
Badge +8

Hi Max

 

With regards to the Composite SmartObject, what tool did you use to creat this? If you use K2 Designer you get less control over how to configure the joins. Use K2 Studio or Visual Studio and you will get extra steps in the wizard to configure the joins.

 

On your list view, are you binding the columns that use list displays to a smartobject field (PART_KEY) ?

Badge +1

First when we did the composite smart object from K2 studio, We joined to an extremely large table and it still brought back the entirity of both tables each time.

 

Then when we attempted to use the list display lookups we are binding the columns when we did a List display to the part_key and then displaying the descriptions etc..

Reply