Skip to main content

Hi, I'm looking for the best way to reuse chained smart object methods, but haven't found a satisfying one. I hope that someone with more experience can tell me if there is a better way.

 

I have to use a web service calls to get information about a user. If the web service returns a complex type it is necessary to pass the result of one smart object method to another. I need to repeat this step (pass the result of a method to the method of another smart object) until I can get the value I'm interessted in. Who's interested in a more complete explanation can have a look at this thread:

http://community.k2.com/t5/K2-blackpearl/Endpoints-Web-Service-Instance-and-Nested-Complex-Types/m-p/71994#M20670

 

I need to reuse the final result in different Activities and Processes. Therefore I would like to create a smart object or something similar in which i set up this command chain. I 'only' want to define this chain once. This is achievable if I create a reference in a process, but in this case it's not reusable in other processes.

 

If there is a way to create a smart object I would be glad because I need to use it in another situation where I have the login name of a user in the sql database and want to return the display name of the user from the AD. It's the same scenario at it is described in the lab 3 of K2 SmartObjects - Intermediate
(LABS). The mentioned way works fine in the demo denallix vm but unfortunalty not in the environment of our customer. If I execute the list method on the composite smart object in the service tester and want to retrieve single (filtered) table row it takes about 10 seconds. According to the log it only takes 5 ms to retrieve the sql data and 58 ms to retrieve the ad data but the joined result is returned after 9333ms.

 

SourceCode.SmartObjects.ServiceBroker oSmartObjectServiceResult.Constructor]","10701 ServiceObject:jSQL].nTable] ListExecuteType:SqlBulkCopy Duration:5ms

SourceCode.SmartObjects.ServiceBroker oSmartObjectServiceResult.Constructor]","10701 ServiceObject:jADService2].nADUser] ListExecuteType:SqlBulkCopy Duration:58ms"

,"anonymous","0.0.0.0","SRWGT858:C:Program Files (x86)K2 blackpearlHost ServerBin","187300","1958be05d0da4f06b7a88bf9707943fb",""
"187301","2014-09-25 15:02:46","Debug","SmartObjects","10046","ExecuteSmartObjects","SourceCode.SmartObjects.Runtime tExecuteScalar]","10046 SmartObject execution event raised successfully.","anonymous","0.0.0.0","SRWGT858:C:Program Files (x86)K2 blackpearlHost ServerBin","187301","72d0dbe4b0d24b1c8192ce3334c0b5b2",""
"187302","2014-09-25 15:02:46","Info","SmartObjects","10530","ExecuteMethod","SourceCode.SmartObjects.Runtime tReturnResultsText(int transferRecords) r20000]]","10530 Executing Method: '15:02:46 ReturnResultsText(int transferRecords) r20000]' ...","anonymous","0.0.0.0","SRWGT858:C:Program Files (x86)K2 blackpearlHost ServerBin","187302","427ca2cf3bf845c7a7045745fd65acfc",""
"187303","2014-09-25 15:02:46","Info","SmartObjects","10531","CompleteMethod","SourceCode.SmartObjects.Runtime tReturnResultsText(int transferRecords) r20000]]","10531 Completed Method: '15:02:46 ReturnResultsText(int transferRecords) r20000]'","anonymous","0.0.0.0","SRWGT858:C:Program Files (x86)K2 blackpearlHost ServerBin","187303","cd4fb2e434e9401e855a213cbd35b62d",""
"187304","2014-09-25 15:02:46","Info","SmartObjects","10531","CompleteMethod","SourceCode.SmartObjects.Runtime tExecuteList(byte(] brokerPackageAx, ExecuteListReaderOptions options)]","10531 Completed Method: '15:02:46 ExecuteList(byte(] brokerPackageAx, ExecuteListReaderOptions options)'","anonymous","0.0.0.0","SRWGT858:C:Program Files (x86)K2 blackpearlHost ServerBin","187304","b8c4a1529b9846fd86aeaa71ea203ec4",""
"187305","2014-09-25 15:02:46","Debug","System","1039","InternalSessionMarshalComplete","SourceCode.Hosting.Server.Runtime.HostServerBroker.InternalMarshal","1039 Session Marshal EC4D628458EED1968C7AC8523349D041.SourceCode.SmartObjects.Runtime.SmartObjectClientServer.ExecuteList Complete (duration 9333 ms)","

 

This is probably due to the fact, that the AD is queried for all users and after all data is retrieve the join is applied. I would prefer to query the database and afterwards pass the login names to the AD Smart Object (chain the smart object methods)  which populates the necessary properties.

 

If someone knows of a working reusable solution I would be glad to get some details about it.

 

Thanks

Be the first to reply!

Reply