| Skelta Workflow.NET 2004 Help |
| Using Work Action
|
Skelta Workflow.NET 2004 provides some standard
actions, which can be used for creating the workflows. The Work action is one
of the most powerful and flexible actions among them. The Work action can be
created based on user roles and without roles. The UI to configure the Work
action properties can be displayed in either a Role Based View or a General
View. This reduces much of the need for creating custom actions.
The Role-based Work action is used to provide the
flexibility of showing the UI based on the user role. The Work action is
configured using XML configuration files and a HTML template to render the UI.
Work Action with General Functionality (without Role):
-
Users will only be able to show the same UI in the Activity List – based on the
AdvanceUI Fields property set for the Work Action – to all resources who log
in, without any control over what information they may be allowed to view or
may be interested in viewing.
-
Users have to select the XML file to be used to specify the configuration in
the AdvanceUI Fields property. (The HTML Template file that will be using these
configuration settings to render the output is also specified in this XML
file.)
-
Users also have to specify the possible outputs for the Action (Action Output),
Input Variables used to render the button value or dropdown, and the Output
Variables used to store information such as comments in workflow variables, in
the AdvanceUI Fields property.
Work Action with Role Based Functionality:
-
Users will be able to show a customized UI in the Activity List – based on the
AdvanceUI Fields property set for the Work Action – to each resource who logs
in, based on their user role. As a result the UI can be dependent on what
information they may be allowed to view or may be interested in viewing.
-
Users have to specify in the AdvanceUI Fields property, which XML file is to be
used to render the output for each role defined.
-
Users also have to specify the possible outputs for the Action (Action Output),
Input Variables used to render the button value or dropdown, and the Output
Variables used to store information such as comments in workflow variables, in
the AdvanceUI Fields property.
Activity Control Properties to be set for enabling Role
Based View in Activity List:
To enable Role Based UI in the Activity List it is mandatory to set either of
these Activity Control properties - LoggedInUserIDInteger
or LoggedInUserIDString.
The "Approve Reject and Escalate.xml" XML configuration file is shown below:
Elements and attributes specified
in the XML file:
Template Name: The name of
the HTML file that will be used by this action to render it in the UI control
is specified in the <HtmlTemplate> element.
ActionOutPut Variables: The
ActionOutput variables that are used to specify all the possible outcomes for
the action are specified using the ActionOutput element. The attributes to be
specified are described here.
-
Name: The name of the ActionOutput variable.
-
Completion Maker: The setting that will determine whether the action
is completion maker or not.
-
Alias: The alias name for the Output that will be displayed as the
output when the action is linked in the workflow.
Input Variables: The Input
Variables that are used to fill the button values, dropdown values, etc., are
configured using the InputVariable element. The values for the input variables
are associated with workflow variables or with static values. The attributes to
be specified are described here.
-
Name: The name of the input variable that will be used as the
placeholder in the HTML template.
-
Type: The field type that is used to define whether it will be a
Textbox or Dropdown.
-
Desc: A short description of the purpose of the Variables.
-
Values: The values to be associated with the variables; Comma
separated values need to be specified in the case of dropdowns (e.g., Yes/No).
-
DefaultValue: The default value for this variable; it can be static
value, variable collection value, and content value.
-
ValueType: The value type that is used to define whether it will be a
variable or content or static value.
Output Variables: The
Output Variables that will be used to store the values from various attributes
are configured using the OutputVariable elements. The attributes to be
specified are described here.
-
Name: The name of the output variable; it will be the same as the
HTML Element Id.
-
Desc: A short description of the purpose of the Variables.
-
Html Element Id: The name of the HTML element from which the value
has to be read.
-
Valuestoset: The type to which value has to be stored
(Variable/Content).
Note: When you use Input
Variables for displaying the button value that will render in the UI, you need
to make sure that the Input Variable value and the ActionOutput variable Alias
value denoted as Mapped Outputs must be the same.
The "Approve Reject and Escalate.htm" HTML Template file is shown below:
(This template uses the parameters defined in the “Approve Reject and
Escalate.xml” file to render the UI to the user.)
The part of the HTML Template
where the placeholders are replaced with the input variables configured in the
XML file is shown below. This template should have a hidden variable named
actionOutPut, for capturing the value inside the control for alerting the
action.
<TABLE WIDTH="100%" BORDER="0" CELLSPACING="1" CELLPADDING="1">
<TR class="N-MainBGCOLOR">
<TD align=center width="15%">
<input type="Submit" class="button2" name="btnClickSubmit"
value="<%#approvealias%>" onclick="javascript:BtnClicked(this)">
</TD>
<TD align=center width="15%">
<input type="Submit" class="button2" name="btnClickSubmit"
value="<%#rejectalias%>" onclick="javascript:BtnClicked(this)">
</TD>
<TD align=center width="15%">
<input type="Submit" class="button2" name="btnClickSubmit"
value="<%#escalatealias%>" onclick="javascript:BtnClicked(this)">
</TD>
<input type="hidden" name="actionOutPut" value="" >
</TR>
</Table>
<Script>
function BtnClicked(clickObj
{
document.getElementsByTagName("input")["actionOutPut"].value
= clickObj.value;
}
</Script>
|
Note: 1.
The placeholder name used in the template should be the name of the input
variables used in the xml file so that the placeholder value will get replaced
at run time with the input variable value. In the above example,
“approvealias”, “rejectalias” and “escalatealias” are the input variables in
the Approve Reject and Escalate.xml file.
2. The function “BtnClicked(clickObj)” is used to
capture the output to alert the action with the output.
Steps to create an XML Configuration file for the Work Action:
Consider the example of displaying
the UI shown below to the users. For this, you will need to create the XML
configuration file and the HTML Template file, say WrkSendBack.xml and
WrkSendBack.htm, under the "…\Actions\WorkAction" folder. This section
describes the steps to create the XML file.
Specifying the start and end tags:
-
The start tag and end tag for the xml file are <WorkTemplate> and </
WorkTemplate> respectively.
Specifying the HTML Template Name:
-
The next node to specify is
<HtmlTemplate>WrkSendBack.htm</HtmlTemplate>, where WrkSendBack.htm
is the HTML Template file corresponding to this XML file. This template will
also be created under the …\Actions\WorkAction folder.
Specifying Action Outputs:
-
The next node is <ActionOutputs></ ActionOutputs>
-
Inside this node you need to specify all the possible outputs for this action
as shown below
-
<ActionOutput name="Approve" CompletionMaker="Yes"
Alias=""></ActionOutput>
-
<ActionOutput name="Reject" CompletionMaker="Yes"
Alias=""></ActionOutput>
-
<ActionOutput name="Send Back" CompletionMaker="Yes"
Alias=""></ActionOutput>
-
You can specify a value in the alias attribute so that it will appear in the
AdvanceUI property of Work Action for these action outputs. Alternatively, you
can skip setting this attribute here and enter the values in the property.
Specifying Input Variables:
-
The next node is <InputVariables></ InputVariables>
-
Inside this node you need to specify all the input variables that you can use
to fill the values in the HTML Template (WrkSendBack.htm) for this action
-
For example, let us assume you need to display three buttons in the UI for this
work action. The values for these buttons can be filled with the help of Input
Variables, which will be used to replace the placeholders in the HTML Template
file (WrkSendBack.htm). Inside the node specify the input variables for this
action as shown below,
-
<InputVariable name="approvealias" type="textbox" Desc="Replace Word
approvealias with" valueType="Value"
Defaultvalue="Approve"></InputVariable>
-
<InputVariable name="rejectalias" type="textbox" Desc="Replace Word
rejectalias with" valueType="Value"
Defaultvalue="Reject"></InputVariable>
-
<InputVariable name="sendbackalias" type="textbox" Desc="Replace Word
sendbackalias with" valueType="Value" Defaultvalue="Send
Back"></InputVariable>
-
You can specify a value in the alias attribute so that it will appear in the
AdvanceUI property of Work Action for these action outputs. Alternatively, you
can skip setting this attribute here and enter the values in the property.
Specifying Output Variables:
-
The next node is <OutputVariables></ OutputVariables>
-
Inside this node you need to specify all the Output Variables you will be using
to map to workflow variables to store the HTML element values, if required.
Specify the variables as shown below,
-
<OutputVariable name="txtcomment" desc="Store Comments In"
HtmlElementId="txtComment" valuestoset="Variable"></OutputVariable>
-
The name of the output variable and the name of the HTML Element Id should be
the same.
Steps to create a HTML Template file (WrkSendBack.htm) for the Work Action to
render the UI shown in the previous section:
<TABLE WIDTH="100%" BORDER="0" CELLSPACING="1" CELLPADDING="2">
<TR height=10%>
<%#Acknowledge%>
</TR>
<%#Notes%>
<TR VALIGN="TOP" CLASS="RUNTEXT1">
<TD width=75%>
<IFRAME
name="<%#framename%>" src="<%#DocumentWindow%>" width="100%"
height="100%" Border="0">
</IFRAME>
</TD>
<TD>
<TABLE WIDTH="100%" BORDER="0"
CELLSPACING="1" CELLPADDING="5">
<TR CLASS="RUNTEXT1">
<TD
align=left>
Comments
</TD>
</TR>
</TABLE> <TD
align=center width="15%">
<input type="Submit" class="button2" name="btnClickSubmit"
value="<%#escalatealias%>" onclick="javascript:BtnClicked(this)">
</TD>
</TR>
<TABLE>
<TABLE WIDTH="100%" BORDER="0" CELLSPACING="1" CELLPADDING="1">
<TR class="N-MainBGCOLOR">
<TD align=center width="15%">
<input type="Submit" class="button2"
name="btnClickSubmit" value="<%#approvealias%>"
onclick="javascript:BtnClicked(this)">
</TD>
<TD align=center width="15%">
<input type="Submit" class="button2"
name="btnClickSubmit" value="<%#rejectalias%>"
onclick="javascript:BtnClicked(this)">
</TD>
<TD align=center width="15%">
<input type="Submit" class="button2"
name="btnClickSubmit" value="<%#sendbackalias%>"
onclick="javascript:BtnClicked(this)">
</TD>
<input type="hidden" name="actionOutPut"
value="" >
</TR>
</Table>
<Script>
function BtnClicked(clickObj
{
document.getElementsByTagName("input")["actionOutPut"].value
= clickObj.value;
}
</Script>
|
Note: 1.
The <%#Acknowledge%> placeholder is used to display the Read
Acknowledgement.
2. The <%#Notes%> placeholder is used to display
the notes if we specify in the action.
3. TThe <IFRAME> tag is used to display the
details page inside an IFrame.
4. The <TEXTAREA> tag is used to show the
comments.
5. The "<%#approvealias%>",
"<%#rejectalias%>" and "<%#sendbackalias%>" placeholders are used
as the input variables in the WrkSendBack.htm file.
6. The "actionOutPut" hidden variable is used to store
the output to alert the action with.
7. The function "BtnClicked(clickObj)" is used to
capture the output to alert the action with.
Steps to use the created xml file (WrkSendBack.xml) and HTML template
(WrkSendBack.htm) in the Work Action:
-
Click on the AdvanceUI Fields property in the Work Action
-
You will see the file name in the File Name dropdown (of both General View and
Role Based View)
-
Select this file name and then click on Action Outputs or Input Variables or
Output Variables to display the corresponding property screen; you can see the
parameters configured in the xml file displayed in the property screen
-
Enter the values in the respective property screen; then save and deploy the
workflow
-
After you execute the workflow you will find the ActivityUI rendered as shown
in the earlier image
Steps to Use GroupUI:
-
This template will be used for displaying the Activity List UI to the
participants when GroupUI is enabled in the activitylist control. GroupUI is
used to display the activity list when the participant wants to act on multiple
activities
-
A number of different templates are available for use in the GroupUI folder
under the ...\Actions\WorkAction\ folder. You can create your own templates in
the GroupUI folder under the ...\Actions\WorkAction\ folder.
For details on setting the Work
Action properties, see the
Work Action topic under References\Actions\Resource Actions.
Skelta - A BPM Workflow Software Company