Creating a Line Rule Copier in the K2.net™ 2003 Studio Task Pane
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. 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 FilesK2.net 2003Bin 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 FilesK2.net 2003Bin directory if it does not exist. | ||
• | Create the LineRuleCopier directory inside the C:Program FilesK2.net 2003BinTaskPanes 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 FilesK2.net 2003BinTaskPanesLineRuleCopier 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: | ||
| |||
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. | ||
|