K2ROM ViewProcessInstance method
+8
The output of this method is an XML type string.
Looking at the contents I get the idea that it can be used as input for the ViewFlow control, is this correct?
If so, how does one get a ViewFlow graphic on an External aspx page?
Regards
Deon
Looking at the contents I get the idea that it can be used as input for the ViewFlow control, is this correct?
If so, how does one get a ViewFlow graphic on an External aspx page?
Regards
Deon
Hi Deon
Yes, the XML string is indeed the input parameter for the ViewFlow control.
To incorporate the ViewFlow control on a custom web page (aspx), do the following:
1. Create an aspx page and in this page's directory add "ViewProcessInstance.dll". This assembly can be found in "...Program FilesK2.net 2003K2WSWorkspaceWorkspaceK2MIS".
2. Add a hidden textbox named strXML as below:
<INPUT id="strXML" type="hidden" Runat="server">
3. Add the following script block to your page:
<SCRIPT language="javascript" id="clientEventHandlersJS">
<!--
function window_onload() {
ctlVF.Xml = document.all("strXML").value
ctlVF.ScrollBars = true
}
//-->
</SCRIPT>
4. Add the following <OBJECT> tag, as is, within the <BODY>:
<OBJECT id="ctlVF" height="100%" width="100%" data="data:application/x-oleobject;base64,IGkzJfkDzxGP0ACqAGhvEzwhRE9DVFlQRSBIVE1MIFBVQkxJQyAiLS8vVzNDLy9EVEQgSFRNTCA0LjAgVHJhbnNpdGlvbmFsLy9FTiI+DQo8SFRNTD48SEVBRD4NCjxNRVRBIGh0dHAtZXF1aXY9Q29udGVudC1UeXBlIGNvbnRlbnQ9InRleHQvaHRtbDsgY2hhcnNldD13aW5kb3dzLTEyNTIiPg0KPE1FVEEgY29udGVudD0iTVNIVE1MIDYuMDAuMjgwMC4xNDAwIiBuYW1lPUdFTkVSQVRPUj48L0hFQUQ+DQo8Qk9EWT4NCjxQPiZuYnNwOzwvUD48L0JPRFk+PC9IVE1MPg0K"
classid="http:ViewProcessInstance.dll#ViewProcessInstance.ViewControl" VIEWASTEXT>
</OBJECT>
5. In the code behind, add a reference to the K2ROM object
6. Create a connection to the K2 Server
7. Call the ViewProcessInstance method of the connection object, passing in a known Process Instance ID as the parameter
8. Assign the return value (an XML string) to the hidden asp textbox
Example:
private void Page_Load(object sender, System.EventArgs e)
{
SourceCode.K2ROM.Connection K2C = new
SourceCode.K2ROM.Connection();
K2C.Open("<ServerName>"[,"<Domain,User,Password>"]);
string xml = K2C.ViewProcessInstance(<Valid Process Instance ID>);
this.strXML.Value = xml;
}
And that's basically all that is required.
NOTES:
1. Because the control is an ActiveX Assembly, the .NET Framework 1.1 is required on the client to view the process instance.
2. Remember to check Internet Explorer security settings and .NET Framework configurations if the empty activeX logo is displayed instead of the ViewFlow graphic
Hope this helps.
Kind Regards,
Bruce
SourceCode EMEA
Yes, the XML string is indeed the input parameter for the ViewFlow control.
To incorporate the ViewFlow control on a custom web page (aspx), do the following:
1. Create an aspx page and in this page's directory add "ViewProcessInstance.dll". This assembly can be found in "...Program FilesK2.net 2003K2WSWorkspaceWorkspaceK2MIS".
2. Add a hidden textbox named strXML as below:
<INPUT id="strXML" type="hidden" Runat="server">
3. Add the following script block to your page:
<SCRIPT language="javascript" id="clientEventHandlersJS">
<!--
function window_onload() {
ctlVF.Xml = document.all("strXML").value
ctlVF.ScrollBars = true
}
//-->
</SCRIPT>
4. Add the following <OBJECT> tag, as is, within the <BODY>:
<OBJECT id="ctlVF" height="100%" width="100%" data="data:application/x-oleobject;base64,IGkzJfkDzxGP0ACqAGhvEzwhRE9DVFlQRSBIVE1MIFBVQkxJQyAiLS8vVzNDLy9EVEQgSFRNTCA0LjAgVHJhbnNpdGlvbmFsLy9FTiI+DQo8SFRNTD48SEVBRD4NCjxNRVRBIGh0dHAtZXF1aXY9Q29udGVudC1UeXBlIGNvbnRlbnQ9InRleHQvaHRtbDsgY2hhcnNldD13aW5kb3dzLTEyNTIiPg0KPE1FVEEgY29udGVudD0iTVNIVE1MIDYuMDAuMjgwMC4xNDAwIiBuYW1lPUdFTkVSQVRPUj48L0hFQUQ+DQo8Qk9EWT4NCjxQPiZuYnNwOzwvUD48L0JPRFk+PC9IVE1MPg0K"
classid="http:ViewProcessInstance.dll#ViewProcessInstance.ViewControl" VIEWASTEXT>
</OBJECT>
5. In the code behind, add a reference to the K2ROM object
6. Create a connection to the K2 Server
7. Call the ViewProcessInstance method of the connection object, passing in a known Process Instance ID as the parameter
8. Assign the return value (an XML string) to the hidden asp textbox
Example:
private void Page_Load(object sender, System.EventArgs e)
{
SourceCode.K2ROM.Connection K2C = new
SourceCode.K2ROM.Connection();
K2C.Open("<ServerName>"[,"<Domain,User,Password>"]);
string xml = K2C.ViewProcessInstance(<Valid Process Instance ID>);
this.strXML.Value = xml;
}
And that's basically all that is required.
NOTES:
1. Because the control is an ActiveX Assembly, the .NET Framework 1.1 is required on the client to view the process instance.
2. Remember to check Internet Explorer security settings and .NET Framework configurations if the empty activeX logo is displayed instead of the ViewFlow graphic
Hope this helps.
Kind Regards,
Bruce
SourceCode EMEA
+8
Thank you for the reply Bruce, but I can't get it to work.
+8
:shock:
I placed the dll in the bin directory of the web app, after putting it in the root of the web app, it works 100%, thank you Bruce.
I placed the dll in the bin directory of the web app, after putting it in the root of the web app, it works 100%, thank you Bruce.
Great. And thanks for letting us know.
:D
:D
+13
Is there an issue with this method on IE8? I get a blank screen. I verified that the XML is being retrieved from the server.
Project is VS2008 targeting .NET FW 3.5 and client has FW 1.1 installed. I do not get a warning or error icon from IE.
ViewProcessInstance.dll is v3.4110.1.0 (from SP4a) and tried placed it in app root or in directory.
Note: I can use the existing viewflow.aspx, and I even replicated what's in its aspx page but the control still displays blank image.
+11
try installing the latest update of k2 blACKPEARL kb450.
I HOPE THIS WORKS WITH YOU
Reply
Enter your username or e-mail address. We'll send you an e-mail with instructions to reset your password.