Joining Smart Objects - advise requested


Badge +1

Hi, I have 2 Smart Objects -

1. Connected to a view in Oracle database that fetches [name, id, yearmonth, user] - acts as master data

2. Connected to a webservice that fetches data from another table where we have [id, yearmonth, otherValue] - acts as details data

They are associated in K2 designer as 1[id] == 2[id], such that when I fetch rows from Smart Object [2], then it displays in the table - [name, otherValue]

The data stored in the View (SO=1) has multiple occurances of the same [id,name]  by yearmonth and user

 

The catch here is - when user will want to add a new data, then there will be a list box which will display [name] from SO=1 which are valid for that user and yearmonth, then provide the details and Save the data to the details table.

 

When I run the view, I am unable to tell K2 to fetch data from master (SO=1) based on passed [yearmonth, userkey] parameter. As a result of which, I am having a cartesian return in the list.

 

Can you please advise if the approach is correct?

 

Many thanks in advance,

Saikat.

 

 


2 replies

Badge +2

If I understand you correctly, can you add the 2 filters (yearmonth, userkey) to your listview, or whenever you need to repopulate it?  Assuming your composite smartojbect is returning both of these fields as well.

Userlevel 1
Badge +8

What you might try doing is mapping the parameters as properites on the Smart Object if possible. Property values can be shared across method calls so a return from one call populates the property and then that property value will flow into the next method call. I know on the SQL broker you can force it to expose parameters as properties, but I cannot recall off the top of my head on the Oracle broker (I'd look but I don't have my VM up at the moment.)

 

Just a word of caution, depending on volume this will put a lot of load on the K2 Server and have some performance challenges on the Oralce side. Oracle views are known to bring back all data before filtering in Oracle then that full data set will be transfered to K2 before it is further manipulated as part of the join you describe.

Reply