Skip to main content

Hello all,


I am using an InfoPath 2010 web browser form with Blackpearl version 1320 in a Visual Studio 2010 development environment.


We are upgrading an existing process from k2.net 2003. The 2003 workflow uses a data manipulation event to populate an XML process field. A subsequent data manipulation event builds a url to the XML data created for the process. The created url can then be used externally (outside of blackpearl) so users can see the form data. I've updated an image from the 2003 workspace.


Is there anyway to reproduce a similar output in blackpearl? Basically, I'm looking for a way to view form data once the process is complete.


Thanks in advance,
Andrea


10993i8EB58B4BD6510900.jpg

Hi Andrea,


K2 blackpearl still has a Data Event which you can use to manipulate the data in an XML field. You can use the "Transfer Data" option to set an XML node's value. If you want to Manipulate the structure of the nodes you can use the "Manipulate XML Data" option. If you want to create a nice form view as you had in K2.net 2003, use the "Transform Data with an XSL Template" option and apply the template to the data.


I don't think K2 blackpearl has the same functionality to render your XML field with the nice form view. You might need to investigate using a custom ASPX form which will retrieve the transformed XML data and display it to the user.


I hope this helps!


Hi Johan,


Thanks very much for the help!


I have given the Data Event option a try and I can produce the XML in a good format. However, can I build a url to link to the XML document within K2 blackpearl? For example, below is the code we used in 2003 to create a link.


public void Main(ref ServerEventContext K2)
{
 //Retrieve current process ID from Datafield (manually updated)
 string procID = K2.ProcessInstance.DataFieldsi"K2ProcID"].Value.ToString();
 string procInstanceID = K2.ProcessInstance.ID.ToString();
 string URL = "http://bollabk201/K2V3/Workspace/Report/xmlData.aspx?ProcID=" + procID + "&ProcInstID=" + procInstanceID + "&FieldName=FormView";
 
 K2.ProcessInstance.DataFieldsa"FormViewURL"].Value = URL;
 K2.Synchronous = true;
}


Example URL would be: http://bollabk201/K2V3/Workspace/Report/xmlData.aspx?ProcID=984&ProcInstID=80815&FieldName=FormView


Is there something equivalent in blackpearl?


Thanks again,
Andrea


I am also interested in a solution to replace xmldata.aspx.


Hi Andrea,


Yes this is absolutely possible all without code.


Configure a Data Event and set the destination as your "FormViewURL" data field. In the source field drag in an Expression Inline function. Here you can configure it by typing in values and concatenating it with Data Field/XML Field values as well as Process Context Data. The Workflow Context exposes the ProcessInstance.ID and is available from the K2 Object/Context Browser under the 4th tab.


Your expression will probably look like this: (Everything in curly brackets are dragged-in fields from the context browser)


"http://bollabk201/K2V3/Workspace/Report/xmlData.aspx?ProcID=" & {InlineFunction.Conversion.ToString(ProcessDataFieldd"ProcID"])} & "&ProcInstID=" & {InlineFunction.Conversion.ToString(WorkflowContextProcessInstance.ID)} & "&FieldName=FormView"


Regards,


Hi Johan,


I gave your suggestion a try and was able to create the url as you suggested in our blackpearl installation (example below). However, we do not seem to have the ".../Workspace/Report/xmlData.aspx..." page on our installation. Please also see an image of the error that I see when I try the link. I took a look into our server hosting blackpearl and do not see that folder.


Example form view url: http://boldevk2pearl01:81/Workspace/Report/xmlData.aspx?ProcID=349&ProcInstID=404&FieldName=FormView


We are using Blackpearl version 4.5 1320 - is /Workspace/Report/xmlData.aspx available in a later patch/ release?


Thanks,
Andrea


12737iE8E23D42BE835F14.jpg

The behaviour in K2.net 2003 that you are using (transforming the InfoPath XML using XSLT) is no longer built into the XML Data viewer. To get similar behaviour, there are 2 options I can think of:



  1. Use a tracking view in the process. This is fairly common and really easy to implement (no custom code needed). Basically, you need to create a view in the IP Form that has all the data you need as read-only fields. At each milestone, you simply set the my:DocumentView field to the name of this view (Data Event) and after that, upload the IP field to a Tracking Library in SharePoint (SharePoint Document Event). The link to this can be saved to your process for reference (in mails, web pages, etc)
  2. Create your own page that transforms the XML using the XSLT. For this you will need to keep your own copy of the XSLT if you have multiple versions. An easy option could be to add that as a datafield and retrieve that along with the XML data that needs to be transformed.

I would opt for point 1, easy and clean.


Thanks for the ideas dc.


Option 1 - I have tried and successfully implemented this solution. However, the workflow is for our engineering change process, which is hundreds of processes per month. We would like to reference the url to the created form view in our CAD file management system as well. Basically, we would need to retain a large number of the form view documents for a long period of time in the Tracking Library. I believe this would be redundant, as the same data resisdes in blackpearl.


Option 2 - Without the XML Data viewer, I think building our own page to display the XML data stored in blackpearl is the best option for us. I think I was just hoping that the XML data viewer was still an option somehow ; )


Thanks again,
Andrea 


Andrea,


Are you going to use SmartObject to fetch completed workitem's XML data field?   (I don't use InfoPath).


I have an .ASP version that combines the xml post to combine with xsl from a Winform.


It's not an URL that fetches the xmldata from K2 (which xmldata.aspx provides).


Reply