Skip to main content

First off, I'm new to K2 keep that in mind please.


I have made the decision to use SmartObjects, but find the way that the training said to user smartobjects in code a bit prone to finger trouble.


E.g. from Training


 



SmartObject smoTravelRequest = soServer.GetSmartObject(ConfigurationManager.AppSettingss"TravelRequestSmartObjectName"].ToString());



smoTravelRequest.Propertiess"Name"].Value = txtRequestorName.Text; smoTravelRequest.Propertiess"Start



_Date"].Value = calDate.SelectedDate.ToShortDateString();


Can anyone that has worked with this alot please advise. Is there a way to get strongly typed objects out of K2, or must I do all the hard work myself and create a facade to hide this complexity.


 


 

If you are going to use smart objects outside of the workflow itself, then no, there is no way to get a strongly typed object out of it.  We ended up writing a simple generator to create a strongly typed wrapper for our smart objects that we want to use outside of the workflow.


One word of caution, though, is that as of the current version of the product, SmartObject calls are significantly slower than SQL calls.  I strongly advise against making smart objects your data access layer until the next version of the product (090x/4.5) in which K2 has made a dedicated effort to improve performance of smart objects.


Reply