Skip to main content

Hi All,

 

Can anyone tell me if it's possible to create a smart object with a single method that has two method bindings (like a composite smart object) where the first binding retrieves data to the smart object and the second binding uses that data to allow it to be pushed to another system?

 

My initial testing seems to indicate it's not , but this could just be a missunderstanding / miss-configuartion.

 

Ideally I'd like a workflow to make a single smart object call (using one parameter) and have the smart object do all the heavy lifting as there are 20+ data items to be pulled from one system and pushed to the other.  I understand that I can pull the data to the workflow activity but then I need to define the additional columns only for the data to be pushed back out and it not really be relevant to that process instance.

 

Thanks for any insight,

 

Paul.

I have never tried that but it sounds like it should be possible with a composite method.  When you say it didn't work did you get an error?  Did the data not go? 


On my initial test, the one required field on the save method kept reporting an empty value.  This should have came from the initail retrieval so I'll give it a test again and see if I can get furtther if it sounds like it should be possible.


Hmm, looking closer at this I'm not sure it's possible in my current situation which is a big shame.

 

The first method on my SmartObject is a call to a stored procedure to retrieve a load of data and takes two required parameters, lets call these A, and B and brings back a load of data. (SQL Server)

 

The second method is a straight forward table update in another database (Oracle) but the key required column is called REC_ID and it should update the record with all the data brought back from the first method.

 

As the REC_ID property is marked as Required in the smart object, when K2 calls the first method it's expects the REC_ID to be populated with a value.  As it isn't (I can't see anyway of being able to set this as the smart object is executed using the parameters) K2 throws an error saying that the required field REC_ID is missing on the retrieval call (Which is incorrect)

 

If I mark the REC_ID field as not required, the SQL that is generated and sent through to Oracle is malformed (it tries to update this value, rather than using it in the where clause.)

 

:(  


A final update - I found that the malformed Oracle query was the result of the table not having a primary key. Once this was fixed no futher errors were reported.

Setting the the required column on the smart object to "No" allowed both methods to be executed as intended, but the data from the first retrieval (into the smo's properties) was never provided to the second method (using the same smo properties) so it looks like this type of functionality isn't supported.


Reply