Skip to main content

1)Infopath repeating table with SmartObject


I knew that Infopath form may integrade with SmartObject via SmartObject Event, but what if there is a repeating table inside the form? I suggest that there are 2 SmartObjects need to be created and link with a association. Am I right?


2) How to access to form data( fields in the infopath form), and Smartobjects when coding in a server event?


3) Is there any Web.config or app.config stuff with k2 project? which I can store some settings.


 Many thanks!!

Hi,


I'm not 100% sure what you require with the InfoPath forms. You can integrate SmartObject methods into an InfoPath form and have the InfoPath from call these methods by using rules. In this way you can call any method of your SmartObject. If you have a repeating table inside InfoPath and would like a SmartObject to be created for each you probably need to look at the rules for each entry of the repeating table to have it call the create method of your SmartObject. I haven't tried it myself, but that is where I would start looking.


When you integrate an InfoPath form into a process, the InfoPath fields are stored as an XML field in your process. The name of the XML field will be the name of your InfoPath form. (You can view the field using the K2 Object Browser in Process/Activity Data) To access this from a server event use K2.ProcessInstance.XmlFieldse"InfoPathFormName"].Value. Load the XML from this field into an XmlDocument and then use it from there to extract the values you need.


K2 processes can store values in your K2 server and these are called string table values. In K2 blackpear] you can add these fields using the K2 Object Browser in Environment. Right click any object in your environment and add a new field. Choose the field type as a Miscellaneous Field and then specify a name and a value for this field. When you deploy your workflow to the server you would be able to edit the value of this field in runtime using the Management Console in Workspace. You can use the K2 context to get the values of these fields in code: K2.StringTablea"StringTableField"]


Hope this helped!


Reply