Custom Choice Activity
- Last UpdatedJun 10, 2024
- 13 minute read
AVEVA Work Tasks provides a set of interfaces and their supporting classes that can be implemented in the class of a custom activity to provide human activity behavior.
The following code sample shows how to create a sample choice activity that looks and behaves like the AVEVA Work Tasks defined choice activity with the usage of Sample aspx property inside the Sample Choice activity.
Procedure
Dll REFERENCE
System.Web
Workflow.NET.NET2
Skelta.HWS.ActivityHandler
NAMESPACE USED
System
System.Web
System.Web.UI
System.Collections
System.Collections.Generic
System.Text
Workflow.NET.Engine
Workflow.NET.Interfaces
Skelta.Core
Skelta.HWS
To create a Sample Custom Choice Activity
-
Go to Start > Visual Studio > New > Projects >Class Library >SampleChoiceActivity. This step will create a Class Library project in the path specified by the name SampleChoiceActivity.
-
Create two class files under the project SampleChoiceHandler.cs and SampleChoiceControl.cs.
-
In the SampleChoiceHandler.cs class file, inherit the HWSActivityProviderBase class which is the base class for all the resource activities.
-
In the SampleChoiceControl.cs class file, inherit the class ActivityUIBase while rendering the Work Item Detail view. Inherit the INativeWebFormUIControl interface and it is used for setting the Current Work Item context to be used in the Work Item Detail view
using System;
using System.Collections.Generic;
using System.Text;
using Workflow.NET;
using Workflow.NET.PropertyTypes;
using Workflow.NET.Storage;
using Workflow.NET.Interfaces;
using Workflow.NET.Engine;
using Workflow.NET.Engine.Interfaces;
using Skelta.Core;
using Skelta.HWS;
namespace SampleChoiceActivity
{
public class SampleChoiceHandler : HWSActivityProviderBase
{
/// <summary>
/// Constructor for sample Choice Handler Class
/// </summary>
public SampleChoiceHandler()
{
}
/// <summary>
/// Resolves the property names. Existing properties can be given different names using this API.
/// MaximumActorsRequiredForActionCompletion is used in the Skelta for getting the property value
/// as for approval it will be Affirmative Answer for Approval [% or Number] and for choice it will be
/// Affirmative Answer for TaskAssignment Completion [% or Number].
/// </summary>
/// <param name="propertyName">Standard property name.</param>
/// <returns>Property name set for the activity.</returns>
public override string ResolvePropertyName(string propertyName)
{
switch (propertyName)
{
case "MaximumActorsRequiredForActionCompletion":
return "Affirmative Answer for TaskAssignment Completion [% or Number]";
case "MinimumActorsRequiredForActionCompletion":
return "Action Min Limit TaskAssignment Completion [% or Number]";
}
return base.ResolvePropertyName(propertyName);
}
/// <summary>
/// Overrides the Run Method of HWSActivityProviderBase for accessing the Custom Aspx Property
/// </summary>
/// <param name="ExecutionID">ExecutionID of the Workflow</param>
/// <param name="ExecutionDetailsID">ExecutionDetailsID of the Activity</param>
/// <param name="CurrentContext">Context Details of Currently Executing Workflow</param>
/// <param name="CurrentAction">Current Executing Activity</param>
/// <param name="InlinkOutput">The Output from previous Activity Linked to this Activity</param>
/// <param name="Retrying"></param>
/// <param name="Output">Output</param>
/// <returns>ActionResult</returns>
public override Workflow.NET.Engine.Interfaces.ActionResult Run(int ExecutionID, int ExecutionDetailsID, Workflow.NET.Engine.Context CurrentContext, Workflow.NET.Action CurrentAction, string InlinkOutput, bool Retrying, out string Output)
{
//Access custom property before calling the base run
Workflow.NET.Property property = CurrentAction.Properties["SampleASPXProperty"];
Workflow.NET.SampleAspxProperty.SampleCustomASPXPropertyType aspxProperty = (Workflow.NET.SampleAspxProperty.SampleCustomASPXPropertyType)property.PropertyHandler;
CurrentContext.log.LogInformation("@#@AspxProperty.DropDownValue:" + aspxProperty.DropDownValue);
CurrentContext.log.LogInformation("@#@AspxProperty.TextBoxValue:" + aspxProperty.TextBoxValue);
return base.Run(ExecutionID, ExecutionDetailsID, CurrentContext, CurrentAction, InlinkOutput, Retrying, out Output);
}
/// <summary>
/// Gets the possible status list for the activity meaning output for the activity.
/// Choice Activity Uses a Skelta grid property (Action Outputs) for defining output for the action.
/// Below code shows the reading of Action outputs grid property for getting all the action outputs.
/// </summary>
/// <returns>List of possible outputs.</returns>
public override Dictionary<string, string> GetPossibleStatusList()
{
Dictionary<string, string> choiceValueandDisplayValue = new Dictionary<string, string>();
string[] statusList = new string[10];
PropertyGrid p = (PropertyGrid)(((Workflow.NET.Property)CurrentHWSActivity.CurrentActivity.Properties["Action Outputs"]).PropertyHandler);
System.Collections.Hashtable _HtButtonTypes = new System.Collections.Hashtable();
object[] rows = p.GridValue;
int k = 0;
if (rows != null)
{
foreach (object row in rows)
{
object[] cols = (object[])row;
if (cols != null)
{
object[] multipleArray = new object[cols.Length + 1];
int j = 0;
foreach (object col in cols)
{
multipleArray[j] = col;
j++;
}
multipleArray[j] = null;
_HtButtonTypes.Add(k, multipleArray);
k++;
}
}
}
foreach (object[] objRow in _HtButtonTypes.Values)
{
string buttonvalue = objRow[0].ToString();
string decisionmakervalue = objRow[1].ToString();
choiceValueandDisplayValue.Add(buttonvalue, buttonvalue);
}
return choiceValueandDisplayValue;
}
/// <summary>
/// This method is used to check the specified output is completion maker or not.
/// </summary>
/// <param name="Status">Status Passed</param>
/// <returns>True or False</returns>
public override bool IsCompletionMaker(string Status)
{
bool CompletionMaker = true;
PropertyGrid p = (PropertyGrid)(((Workflow.NET.Property)CurrentHWSActivity.CurrentActivity.Properties["Action Outputs"]).PropertyHandler);
System.Collections.Hashtable _HtDecisionMaker = new System.Collections.Hashtable();
object[] rows = p.GridValue;
int k = 0;
if (rows != null)
{
foreach (object row in rows)
{
object[] cols = (object[])row;
if (cols != null)
{
object[] multipleArray = new object[cols.Length + 1];
int j = 0;
foreach (object col in cols)
{
multipleArray[j] = col;
j++;
}
multipleArray[j] = null;
_HtDecisionMaker.Add(k, multipleArray);
k++;
}
}
}
foreach (object[] objRow in _HtDecisionMaker.Values)
{
string buttonvalue = objRow[0].ToString();
string decisionmakervalue = objRow[1].ToString();
if (buttonvalue != "")
{
if (buttonvalue.ToUpperInvariant().Trim() == Status.ToUpperInvariant().Trim())
{
if (decisionmakervalue.ToUpperInvariant() == "YES")
{
CompletionMaker = true;
}
else
{
CompletionMaker = false;
}
}
}
}
return CompletionMaker;
}
}
}
SampleChoiceControl.cs
using System;
using System.Web;
using System.Web.UI;
using System.Collections.Generic;
using System.Text;
using Workflow.NET.Engine;
using Workflow.NET.Interfaces;
using Skelta.Core;
using Skelta.HWS;
using System.Collections;
namespace SampleChoiceActivity
{
/// <summary>
/// The UI for sample custom choice activity is rendered from an HTML file. This will help us in editing the UI with out changing the compiled activity code.
/// The HTML template is placed in folder ([SkelatIntalledPath]\WorkflowElements\Default\en-US\Activities\Activity\SampleChoiceUI.htm)
/// </summary>
public class SampleChoiceControl : Skelta.HWS.ActivityHandler.ActivityUIBase, INamingContainer, Skelta.HWS.WorkListChannel.Web.INativeWebFormUIControl
{
public HWSActivity _HWSActivity;
public WorkItem _WorkItem;
Workflow.NET.Engine.Context WorkflowContext;
Workflow.NET.Log logger = new Workflow.NET.Log();
private Workflow.NET.Parser parseHtml = new Workflow.NET.Parser();
string strTempDirectoryPath = "", strDirectoryPath = "";
Workflow.NET.ActionsData _ActionsData;
/// <summary>
/// Constructor for SampleChoiceControl class
/// </summary>
public SampleChoiceControl()
{
}
/// <summary>
/// This method is used to render the Workitem Detail view
/// </summary>
protected override void CreateChildControls()
{
string InternalStatus = _WorkItem.Status.ToUpperInvariant();
string ErrorMessage = "";
string VariableName = "";
string ActionTaken = "";
string strContent = "";
string strStatus = "";
Dictionary<string, string> GetStatusList = new Dictionary<string, string>();
int poscnt = 0;
string Comment = Context.Request["txtComment"];
if (Comment != null)
Comment = Comment.Trim();
strStatus = Context.Request["btnSubmit"];
if (strStatus != null && strStatus != "")
{
try
{
SynchronousActionData syncData = new SynchronousActionData(HttpContext.Current);
//Submitting the Workitem with the respective output
_WorkItem.Submit("WebWorkList", strStatus, "", Comment, syncData);
//RefreshWorkItemList() is the commonfunction which is used for Refreshing
//the Workitem List after submitting the workitem
this.Controls.Add(new LiteralControl("<script>RefreshWorkItemList();</script>"));
}
catch (Exception e)
{
}
}
if (InternalStatus == "AW"
|| InternalStatus == "OW" || InternalStatus == "HO")
{
//Error message is rendered below the notes.
base.ErrorMessage = ErrorMessage;
//This is called for Rendering a common UI in Workitem Detail View Which is displaying Subject,Notes and Manage Workitem drop down and also
// IFrame which will display the Custom Document view in Left hand side of Details view.
RenderCommonActivityUI(parseHtml);
((IHWSActivityProvider)_HWSActivity.CurrentActivity.ActionHandler).CurrentHWSActivity = _HWSActivity;
GetStatusList = ((IHWSActivityProvider)_HWSActivity.CurrentActivity.ActionHandler).GetPossibleStatusList();
int cnt = GetStatusList.Count;
foreach (string buttonvalue in GetStatusList.Values)
{
if (buttonvalue != "")
{
poscnt++;
strContent = "<input type=\"submit\" class=\"inputbutton\" value=\"" + buttonvalue + "\" name=\"btnSubmit\">";
parseHtml.Replace("Position" + poscnt, strContent);
}
}
int remainingCount = 10 - GetStatusList.Count;
if (remainingCount > 0)
{
for (int m = cnt + 1; m <= 10; m++)
{
parseHtml.Replace("Position" + m, "");
}
}
//Rendering the Detail View UI(SampleChoiceUI.htm)
this.Controls.Add(new LiteralControl(parseHtml.CheckAndProcessFileGetString(strDirectoryPath + "Activities\\Activity\\SampleChoiceUI.htm", strTempDirectoryPath + "cache", "Activities\\Activity\\")));
}
}
/// <summary>
/// Overrides Render Method of Webcontrol
/// </summary>
/// <param name="writer"></param>
protected override void Render(HtmlTextWriter writer)
{
this.RenderBeginTag(writer);
this.RenderChildren(writer);
this.RenderEndTag(writer);
}
#region INativeWebFormUIControl Members
/// <summary>
/// This method Provides information of the current workitem instance.
/// </summary>
/// <param name="workItem">Current Workitem Instance</param>
/// <param name="channelName">Channel Name(WebWorkList)</param>
/// <param name="formName">Form Name(Approval Form)</param>
void Skelta.HWS.WorkListChannel.Web.INativeWebFormUIControl.SetContext(WorkItem workItem, string channelName, string formName)
{
_WorkItem = workItem;
_HWSActivity = workItem.HWSActivity;
WorkflowContext = workItem.CurrentContext;
_ChannelName = channelName;
_FormName = formName;
strTempDirectoryPath = workItem.HWSActivity.CurrentContext.ProcessDefinition.ActionsDefinition.DirTemp;
strDirectoryPath = workItem.HWSActivity.CurrentContext.ProcessDefinition.ActionsDefinition.DirSourceElements;
_ActionsData = workItem.CurrentContext.ProcessDefinition.ActionsDefinition;
base.Initailize(this.Context, workItem);
}
#endregion
}
}
-
Build the Class Library Project and place the assembly in the [AVEVA Work Tasks Installed Path]\AVEVA\Work Tasks\bin folder.
-
Create an HTML Page by the name SampleChoiceUI.htm in the [AVEVA Work Tasks Installed Path]\AVEVA\Work Tasks\WorkflowElements\Default\en-US\Activities\Activity\ folder. This SampleChoiceUI.htm is used for rendering the UI in the Work Item list as a Work Item Detail view. Copy the following contents in the created HTML page.
<TABLE WIDTH="100%" height="100%" BORDER="0" CELLPADDING="2" CELLSPACING="1" class='righttdbg'>
<%#errorMessage%>
<TR VALIGN="TOP">
<TD align="left" width="<%#iframewidth%>" bgcolor="<%#iframebgcolor%>">
<%#iframeui%>
</TD>
<TD>
<TABLE WIDTH="100%" BORDER="0" CELLSPACING="1" CELLPADDING="5">
<TR>
<TD align=left class='subtitle'>
<strong>@@Comments@@</strong>
</TD>
</TR>
<TR>
<TD align="left">
<TEXTAREA name='txtComment' cols=35 rows=15 wrap="VIRTUAL" class="inputtextarea"></TEXTAREA>
</TD>
</TR>
<!--<TR>
<TD align="center"> </TD>
</TR>-->
</TABLE>
</TD>
</TR>
<TR VALIGN="TOP">
<TD height="25" colspan=2 align="right" bgcolor="#ffffff">
<%#Position1%>
<%#Position2%>
<%#Position3%>
<%#Position4%>
<%#Position5%>
<%#Position6%>
<%#Position7%>
<%#Position8%>
<%#Position9%>
<%#Position10%>
</TD>
</TR>
</TABLE>
-
Configure the Actions.XML file available in the [AVEVA Work Tasks Installed Path]\AVEVA\Work Tasks\WorkflowElements\Default\en-US\Actions\XML path for the created Sample Choice activity in the Custom Activities category. While configuring the Custom Activity, you must specify the image filename of type .PNG. The .png image must be of size 40x40 for the custom activity. The image must be available in the following folders:
[AVEVA Work Tasks Installed Path]\AVEVA\Work Tasks\WorkflowElements\Default\en-US\Actions\Images\Normal\Large
[AVEVA Work Tasks Installed Path]\AVEVA\Work Tasks\WorkflowElements\Default\en-US\Actions\Images\Selected\Large
[AVEVA Work Tasks Installed Path]\AVEVA\Work Tasks\BPMUITemplates\Default\ActivityImages
Note: If an XML exception occurs after copying the following configuration to the Actions.XML file, open the Actions.XML file in a browser, and remove the extra spaces, if any.
Copy the following XML code to the <category name= "Custom Activities"> section of the Actions.XML file. For example, <category name= "Custom Activities" sortorder="6" image="custom.gif"><action name="SampleChoice" helptemplate="ChoiceAction1.html" helptemplatewinheight="450" helptemplatewinwidth="600">
<description>Dynamic button action outputs.</description>
<image resourcename="choice.png"></image>
<handler classname="SampleChoiceActivity.SampleChoiceHandler" assembly="bin\SampleChoiceActivity.dll"></handler>
<wizards>
<wizard name="Setup Actors" windowwidth="540" windowheight="290" windowposition="center" category="cat_participants" default="true" description="Use this wizard for quickly setting up Actors for the action" url="ActorsSelectionWizard.aspx">
<![CDATA[Resource=To,Minimum Acknowledgers=Min. Acknowledgements [% or Number],
Maximum Acknowledgers=Max. Acknowledgements [% or Number],
Maximum Resources to Act=Affirmative Answer for TaskAssignment Completion [% or Number],
Minimum Resources to Act=Action Min Limit TaskAssignment Completion [% or Number]]]>
</wizard>
<wizard name="Setup Escalations" windowwidth="540" windowheight="290" description="Use this wizard for setting up Escalations incase the actors dont act on time" url="EscalationEmailWizard.aspx">
</wizard>
</wizards>
<report rendertype="xsl" xsl="ActionDescription.xsl">
<handler class="Workflow.NET.Report.ReportHandler" assembly="Workflow.NET.ReportHandler\bin\Debug\Workflow.NET.ReportHandler.NET2.dll" />
<messages>
<message id="ActionStarted">
<![CDATA[Action <%#ActionName%> of type <%#ActionType%> initiated at <script language='javascript'>WriteClientTime('<%#EventTime%>',1);</script>.]]>
</message>
<message id="ResourceScarcity">
<![CDATA[Action <%#ActionName%> of type <%#ActionType%> completed execution due to lack of actor.
<%#ActionName%> completed with the output <%#ActionOutput%>.]]>
</message>
<message id="FilteredResourceCount">
<![CDATA[The <%#ActionType%> action <%#ActionName%> selected <%#ResourceCount%> actor<%#ResourceOrResources%>.]]>
</message>
<message id="RequestResource">
<![CDATA[The actor named <%#ResourceName%> with identifier <%#ResourceIdentifier%>
has been identified to take part in the <%#ActionName%> action.]]>
</message>
<message id="ResourceUnavailable">
<![CDATA[The actor <%#ResourceName%> with identifier <%#ResourceIdentifier%> and email <%#ResourceEmail%> is unavailable.<br>
The 'Ignore unavailable actor' property for the action was set to <%#IgnoreUnavailableResource%>.<br>
The 'Alternate actor allowed' property was set to <%#AlternateResourceAllowed%>.]]>
</message>
<message id="AvailableResourceCount">
<![CDATA[The action <%#ActionName%> request was sent to <%#ResourceCount%> actor<%#ResourceOrResources%>.<br>
The Minimum No.Of ownerships required is <%#PropertyMin. Acknowledgements [% or Number]()%>.<br>
The Maximum No.Of ownerships is <%#PropertyMax. Acknowledgements [% or Number]()%>.<br>
The Minimum human activity count required is <%#PropertyAction Min Limit TaskAssignment Completion [% or Number]()%>.<br>
The Choice count required for the action to be completed is <%#PropertyAffirmative Answer for TaskAssignment Completion [% or Number]()%>.<br>]]>
</message>
<message id="TimeOutSet">
<![CDATA[Timeout <%#TimeOutType%> scheduled at <script language='javascript'>WriteClientTime('<%#TimeOutValue%>',1);</script>.]]>
</message>
<message id="TimeOutWarningSet">
<![CDATA[Timeout <%#TimeOutType%> warning scheduled at <script language='javascript'>WriteClientTime('<%#TimeOutValue%>',1);</script>.]]>
</message>
<message id="ActionForwarded">
<![CDATA[Action <%#ActionName%> of type <%#ActionType%> was forwarded by actor
<%#ResourceName%> with identifier <%#ResourceIdentifier%> to
<%#ResourceName1%> with identifier <%#ResourceIdentifier1%>at <script language='javascript'>WriteClientTime('<%#EventTime%>',1);</script>.]]>
</message>
<message id="ActionCompleted">
<![CDATA[Action <%#ActionName%> of type <%#ActionType%> completed execution at <script language='javascript'>WriteClientTime('<%#EventTime%>',1);</script> with the output <%#ActionOutput%>.]]>
</message>
<message id="ActionEvent">
<![CDATA[<%#ResourceName%> with identifier <%#ResourceIdentifier%> selected <%#ActionOutput%> for the Action <%#ActionName%> of type <%#ActionType%>. <br>
The Action executed with output <%#ActionOutput%> at <script language='javascript'>WriteClientTime('<%#EventTime%>',1);</script>.
The comment given by actor is :<%#ActionComment%>.]]>
</message>
<message id="ActionSleeping">
<![CDATA[<%#ResourceName%> with identifier <%#ResourceIdentifier%> selected <%#ActionOutput%> for the Action <%#ActionName%> of type <%#ActionType%>.at <script language='javascript'>WriteClientTime('<%#EventTime%>',1);</script>. <br>
The comment given by actor is :<%#ActionComment%>.]]>
</message>
<message id="AckActionEvent">
<![CDATA[<%#ResourceName%> with identifier <%#ResourceIdentifier%> <%#ActionEvent%> the Action <%#ActionName%> of type <%#ActionType%> at <script language='javascript'>WriteClientTime('<%#EventTime%>',1);</script>.]]>
</message>
<message id="ActionEventOutput">
<![CDATA[Perfomed <%#TimeOutType%> calculations based on the properties set. The ouput <%#ActionOutput%> was alerted to engine at <script language='javascript'>WriteClientTime('<%#EventTime%>',1);</script>..]]>
</message>
<message id="SchedulerEvent">
<![CDATA[Perfomed Timeout <%#TimeOutType%> from the scheduler at <script language='javascript'>WriteClientTime('<%#EventTime%>',1);</script>.
The ouput <%#ActionOutput%> was alerted to engine.]]>
</message>
<message id="SchedulerWarningEvent">
<![CDATA[Perfomed Timeout <%#TimeOutType%> warning from the scheduler at <script language='javascript'>WriteClientTime('<%#EventTime%>',1);</script>.
The ouput <%#ActionOutput%> was alerted to engine.]]>
</message>
<message id="CustomFieldWarning">
<![CDATA[Custom field <%#CustomFieldName%>(<%#CustomFieldDisplayName%>) of type <%#CustomFieldType%> couldn't not be added. Process definition for action not updated after changes in custom fields.]]>
</message>
</messages>
</report>
<properties>
<property category="cat_name;01" name="Action Display Name" displayname="Display Name" type="string" helpstring="Display name for the action in activity list."></property>
<property name="SampleASPXProperty" displayname="SampleASPXProperty" type="SampleAspxProperty" helpstring="Sample for rendering UI through an aspx page."></property>
<property category="cat_configuration;02" name="Delivery Channels" type="ChannelSelection">
<propertychannel>
<channels>
<channel name="WebWorkList" supported="true">
<somechanneldata visible="" selected="" mandatory="">
</somechanneldata>
<forms>
<form type="NativeWebForm" supported="true" defaultsetting="" uihandlerclassname="SampleChoiceActivity.SampleChoiceControl" uihandlerassembly="bin\SampleChoiceActivity.dll">
<instance name="Choice Form"/>
</form>
</forms>
</channel>
<channel name="MailWorkList" supported="true" selected="false">
<forms>
<form type="MailWorkForm" supported="true" defaultsetting="">
<instance name="Choice Email Form"/>
</form>
</forms>
</channel>
</channels>
</propertychannel>
</property>
<property category="cat_configuration" name="Action Outputs" type="grid" helpstring="Different button types to be displayed." mandatory="true" helptemplate="Choice-ActionOutputs.html" helptemplatewinheight="450" helptemplatewinwidth="600">
<cols>
<col mandatory="true" titlestring="Button Name" displaywidth="50%" />
<col type="select" values="Select:,Yes:Yes,No:No" mandatory="true">
<titlestring>Completion Maker</titlestring>
</col>
<defaultvalue></defaultvalue>
</cols>
</property>
<property category="cat_configuration" name="Work Item Fields" type="WorkItemField" elpstring="save activity level data to be used for activity list" helptemplate="Choice-WorkItemFields.html" helptemplatewinheight="450" helptemplatewinwidth="600"></property>
<property category="cat_participants;03" name="To" displayname="Assign Actor(s)" type="resource" helpstring="Actor filter, Expression which selects the actors to whom the request needs to be sent." mandatory="false" helptemplate="Choice-AssignActors.html" helptemplatewinheight="450" helptemplatewinwidth="600"></property>
<property category="cat_participants" name="Assign Queue" displayname="Assign Queue(s)" type="Queue" helptemplate="Choice-AssignQueues.html" helptemplatewinheight="450" helptemplatewinwidth="600"></property>
<property category="cat_participants" name="Min. Acknowledgements [% or Number]" displayname="Min. Ownerships [% or Number]" mandatory="true" type="limit" defaultvalue="1" helpstring="Minimum Number of actors who should acknowledge and own the Task Request"></property>
<property category="cat_participants" name="Max. Acknowledgements [% or Number]" displayname="Max. Ownerships [% or Number]" type="limit" defaultvalue="100%" helpstring="Maximum Number of actors who should acknowledge and own the Task Request"></property>
<property category="cat_participants" name="Forwarding Allowed?" displayname="Re-Assign Allowed?" type="choice" defaultvalue="No" helpstring="Allow request to be re-assigned by a actor to another actor?">
<choice>Yes</choice>
<choice>No</choice>
</property>
<property category="cat_participants" name="Ignore Unavailable Resources?" displayname="Ignore Unavailable Actors?" type="choice" defaultvalue="No" helpstring="Ignore actors who are on Holidays?">
<choice>Yes</choice>
<choice>Yes - if No Alternate</choice>
<choice>No</choice>
</property>
<property category="cat_participants" name="Alternate Resource Allowed?" displayname="Alternate actor Allowed?" type="choice" defaultvalue="Yes" helpstring="Allow request to be processed by an Alternate actor as specified by the orignial receipent actor">
<choice>Yes</choice>
<choice>No</choice>
</property>
<property category="cat_notification;04" name="Subject" type="workflowmemo" displaymode="html" helpstring="Subject displayed to user in activity list. Also used as the subject for notification email sent to the user." helptemplate="Choice-Subject.html" helptemplatewinheight="450" helptemplatewinwidth="600"></property>
<property category="cat_notification" name="Notes" displayname="Body" type="workflowmemo" displaymode="html" helpstring="Body/Notes for the approvers.Also used as the body for notification email sent to the user." helptemplate="Choice-Body.html" helptemplatewinheight="450" helptemplatewinwidth="600"></property>
<property category="cat_notification" name="From Email Address" type="email" helpstring="The from email address for email notification sent to the user."></property>
<property category="cat_notification" name="Hide Responses?" defaultvalue="Yes" type="choice" helpstring="Incase multiple actors are acting on this approval, responses from all of them are public or hidden during execution of this action?.">
<choice>Yes</choice>
<choice>No</choice>
</property>
<property category="cat_notification" name="Priority" type="choice" defaultvalue="Medium" helpstring="Severity of the activity">
<choice>High</choice>
<choice>Medium</choice>
<choice>Low</choice>
</property>
<property category="cat_notification" name="Show Custom Document View Window" type="choice" defaultvalue="Yes" helpstring="Displays a window in activity list,which can have custom document view provided">
<choice>Yes</choice>
<choice>No</choice>
</property>
<property category="cat_notification" name="Send Notification Email" defaultvalue="No" type="choice" helpstring="Notification email to user about the request.">
<choice>Yes - HTML</choice>
<choice>Yes</choice>
<choice>No</choice>
</property>
<property category="cat_notification" name="Notify if alternate considered" defaultvalue="No" type="choice" helpstring="Default notification email to be sent or not.">
<choice>Yes - HTML</choice>
<choice>Yes</choice>
<choice>No</choice>
</property>
<property category="cat_notification" name="Redirect URL" type="workflowmemo" helpstring="URL to be redirected after the activity is added to a actor." helptemplate="Choice-RedirectURL.html" helptemplatewinheight="450" helptemplatewinwidth="600"><![CDATA[http://<%ApplicationPath%>/]]></property>
<property category="cat_notification" name="Custom Document View URL" type="workflowmemo" helpstring="URL to be shown in the custom document view." helptemplate="Choice-CustomDocumentViewURL.html" helptemplatewinheight="450" helptemplatewinwidth="600">
<![CDATA[http://<%ApplicationPath%>/]]>
<plugins>
<plugin name="sharepointexplorer" hiddenfield="" jsfunction="WritePluginContentViewUrl" pageurl="../plugins/sharepoint/sharepointexplorer.aspx" pagefeatures="width=450,height=700,top=10" imageurl="../Plugins/SharePoint/Images/sharepoint-explorer.png" description="Click to open the SharePoint Explorer">
<parameters>
<parameter name="Help">Select the SharePoint view which you have defined with required fields to be shown in the custom document view</parameter>
<parameter name="ExplorerLevel">View</parameter>
<parameter name="SelectionLevel">View</parameter>
<parameter name="MultiSelection">False</parameter>
<parameter name="ViewMode">1</parameter>
<parameter name="ReturnParentData">True</parameter>
</parameters>
</plugin>
</plugins>
</property>
<property category="cat_decision;05" name="Affirmative Answer for TaskAssignment Completion [% or Number]" displayname="Max Actors Required For Choice Completion [% or Number]" type="limit" defaultvalue="100%" helpstring="Number or % of actors should act up on the Task in order for the outcome of this action to be set as completed."></property>
<property category="cat_decision" name="Action Min Limit TaskAssignment Completion [% or Number]" displayname="Min Actors Required For Choice Completion [% or Number]" type="limit" defaultvalue="100%" helpstring="Minimum number or % of actors should act up on the Task in order to avoid action timeouts and warning."></property>
<property category="cat_timeout;06" name="Set Calendar" displayname="Set Calendar for Timeout" type="calendar" helptemplate="Choice-SetCalendarForTimeout.html" helptemplatewinheight="450" helptemplatewinwidth="600"></property>
<property category="cat_timeout" name="Minimum Time for Action" displayname="Minimum available time for Activity" type="timespan" defaultvalue="0" helpstring="Min Time (in Day:Hours:Minutes) that is required to finish the action.User should have the this time left for the day to act up on the request."></property>
<property category="cat_timeout" name="Timeout warning for Acknowledgement" displayname="Timeout warning for Ownership" type="timespan" defaultvalue="0" helpstring="Max Time (in Day:Hours:Minutes) which can elapse for actors to acknowledge the request before action will trigger the Timeout warning for ownership link"></property>
<property category="cat_timeout" name="Timeout for Acknowledgement" displayname="Timeout for Ownership" type="timespan" defaultvalue="0" helpstring="Max Time (in Day:Hours:Minutes) which can elapse for actors to acknowledge the request before action will exit with Timeout for ownership link"></property>
<property category="cat_timeout" name="Timeout warning for Action" displayname="Timeout warning for Activity" type="timespan" defaultvalue="0" helpstring="Max Time (in Day:Hours:Minutes) which can elapse for actors to Act on the request before action will trigger the Timeout warning for Action link"></property>
<property category="cat_timeout" name="Timeout for Action" displayname="Timeout for Activity" type="timespan" defaultvalue="0" helpstring="Max Time (in Day:Hours:Minutes) which can elapse for actors to Act on the request before action will exit with Timeout for Action link"></property>
<property category="cat_timeout" name="Multiple TimeOut Warning" displayname ="Multiple Timeout Warning" type="grid" helpstring="Multiple warning escalations for the action, If user doesn't act up on the action for a given time." helptemplate="Choice-MultipleTimeoutWarning.html" helptemplatewinheight="450" helptemplatewinwidth="600">
<cols>
<col mandatory="true" displaywidth="25%" validationtype="timespan">
<titlestring>Time Interval</titlestring>
<choicedefaultvalue>0.00:00:00</choicedefaultvalue>
</col>
<col type="select" values="Select:,Yes:YES,No:NO" mandatory="true" displaywidth="10%">
<titlestring>Recurring?</titlestring>
</col>
<col mandatory="true" displaywidth="40%">
<titlestring>OutPut</titlestring>
<choicedefaultvalue>TimeOutWarning-</choicedefaultvalue>
</col>
<col mandatory="true" displaywidth="25%" validationtype="timespan">
<titlestring>Recurring Time Interval</titlestring>
<choicedefaultvalue>0.00:00:00</choicedefaultvalue>
</col>
</cols>
</property>
<property name="Enable Redirection?" displayname="Redirection Enabled?" type="choice" defaultvalue="No" helpstring="Indicates whether the subsequent actions should be synchronized. If 'Yes', the client waits for the URL from the server and redirects the UI to that URL.">
<choice>Yes</choice>
<choice>No</choice>
</property>
</properties>
<return>
<link property="Action Outputs" defaultcolumn="1"/>
<link property="Multiple TimeOut Warning" defaultcolumn="3"/>
<value helpstring="All the actors has taken part.">Action Completed</value>
<value helpstring="All the actors has not taken part.">Action Completed - Affirmative Percentage Not Reached</value>
<value helpstring="Filter Condition didnt yield enough actors to whom the request can be sent">Not Enough Resources to Acknowledge</value>
<value helpstring="Minimum Actors as specified didnt acknowledge the request in the given time">Timeout - Acknowledgement</value>
<value helpstring="Some or All Actors didnt perform the required action in given time">Timeout - Action</value>
<value helpstring="Warning for Minimum Actors as specified didnt acknowledge the request in the given time">Timeout Warning - Acknowledegement</value>
<value helpstring="Warning since Some or All Actors didnt perform the required action in given time">Timeout Warning - Action</value>
<value helpstring="Queue Participant didn't perform the required action in given time">Timeout Warning- Queue Participant</value>
<value helpstring="No Participant picked the work item from the Queue in given time">Timeout Warning- Queue</value>
<value helpstring="Push dispatch pattern could not find any Actor.">Queue Actor Unavailable</value>
</return>
</action>
Note: Ensure to set the assembly (assembly and uihandlerassembly attributes) correctly. Also ensure that the current configuration loads the dll from AVEVA Work Tasks installed bin folder.
-
Open the Process Designer. The activity is displayed under the Custom Activities category.
-
Drag and drop the activity into the Process Designer. You can see the Custom Aspx Property in the Process Designer
The following figure shows the sample workflow created using the Sample Choice Activity.

We can the see the values set for the ASPX Property in the AVEVA Work Tasks Logger Console.
