Introduction

The K2.net™ 2003 Studio Task Pane is an HTML container which can contain multiple .html pages to add functionality to the standard K2.net™ Studio interface. This article and supporting files, will guide you through the process of adding a new task pane element which can copy the contained Line Rule from a specific line to another line. It will also show you how to gain access to the K2.net 2003 Studio object model.

In order to utilize the Task Pane, we need to create an appropriate .html file containing the required functionality – please refer to the accompanying file: LineRuleCopier.html

This file holds a reference to the currently active K2.net™ 2003 Studio Process for which a handle can be obtained through the following function call:
 

 

Because K2.net™ 2003 Studio will house this HTML file, referring to windows.external.xxx will return a handle to the K2.net™ 2003 Studio object model. Refer to the help file for the full object hierarchy. In the above example though, we gain access to all accessible methods and properties of the currently active process.

Apart from the normal HTML tags, the LineRuleCopier.html file also contains various Java script code procedures adding the required functionality to copy a Line Rule from one line to another. It is however recommended that you first install and test the functionality of this task pane element before you try to understand or change the code procedures.

Installing the LineRuleCopier Task Pane element in K2.net™ 2003 Studio:

•  Close K2.net™ 2003 Studio if it is currently running.
•  By using Windows Explorer, navigate to the C:\Program Files\K2.net 2003\Bin directory.
•  Look for the K2Studio.config file and open it for editing, either in Visual Studio or any other text editor.
•  Add the following entry anywhere between the existing K2Studio tags
 

 
•  Create the TaskPanes directory inside the C:\Program Files\K2.net 2003\Bin directory if it does not exist.
•  Create the LineRuleCopier directory inside the C:\Program Files\K2.net 2003\Bin\TaskPanes directory if it does not exist so that your Task Pane element URL can resemble the one just specified in the K2Studio.config file.
•  Copy the accompanying files called LineRuleCopier.html and Styles.css to the C:\Program Files\K2.net 2003\Bin\TaskPanes\LineRuleCopier directory.
•  Open K2.net™ 2003 Studio and display the Task Pane by selecting Task Pane from the View Menu. You should see something similar to the following:
 

 
Note: In this example, Source and Destination do not refer to the Source and Destination Activities of a single line but rather to two separate Activities from which two lines with the same Line Rule will flow. In a perfect world, where all lines were given unique, descriptive names, it would not have been necessary to specify Source and Destination Activities, but rather just Line Names.

Testing the LineRuleCopier Task pane element:

•  Create a K2 workflow process like the following:
 

 
•  Once you have created a process, click on the Refresh link inside the Task pane in order to re-load the .html page controls (combo boxes) with the defined activity and line names. This will result in an updated task pane looking as follows:
 

 
•  In the above process example, we would typically create a Line Rule for ApproveLineA and copy this rule to the other two lines ApproveLineB and DeclineLine respectively. If all three Line Rules should not be exactly the same, we can always edit and change it accordingly after the copy process.
•  To copy the Line Rule from ApproveLineA to ApproveLineB, select the values as shown in the following figure and click on Copy in the Task pane.
 

 
•  A message box confirming the copy action will appear. If you select Ok to continue the copy operation, your line rules for the two lines should be exactly the same.

 
What’s Next

Now that you have seen the functionality of the LineRuleCopier, you can examine the .html file. The LineRuleCopier.html file is fully commented and will explain more on how to interact with the K2.net™ Studio environment and object model.

The LineRuleCopier Task pane element is an example only, and will therefore not be supported by K2.net™ Support Desk.