Configure ASPX Form as Work Item Detail View Page
- Last UpdatedJun 10, 2024
- 4 minute read
You can configure an ASPX form as the Detailed View page of the Work Item List Control. This topic describes the steps to configure the ASPX form.
To Configure the ASPX Form as a Detailed View Page
-
Select the Human Activity.
-
Click the Delivery Channels Property. A new window opens, as shown below.

-
Right-click the WebWorkList to display the context menu with the Add Instance of Aspx form option, as shown below.

-
Click the Add Instance of Aspx form option. In the configuration settings fields that are displayed, specify the URL of the ASPX form, as shown below. You can specify the Relative or absolute Url in the text box.


-
If you are accessing the Work Item List Control from the EC Site, then the CustomAspxPageDefault.aspx page should reside in the BPMUITemplates\Default\Repository\Site folder.
-
Set the Aspxform1 as the default instance by right-clicking Aspxform1 and selecting the Set as default instance option from the context menu.

-
Click the Save and Save Channels buttons.
-
Following are the steps and code samples for the Custom Aspx form to appear as Work Item detail view.
-
Create the CustomAspxPageDefault.aspx and CustomAspxPageDefault.aspx.cs in the BPMUITemplates\Default\Repository\Site folder.
-
In the CustomAspxPageDefault.aspx.cs file we will get the work item details using the Skelta.HWS.WorkListChannel.Web.WebWorkItemAdapter object. The Url respective to Work Item controls are secured. The Secured Url is getting build when we select a row from the Work Item list control using the WebWorkItemAdapter object. In the Custom Aspx page, we need to access the work item related details from the Secured url. The Processing of Secured url is achieved through the WebWorkItemAdapter object.
CustomAspxPageDefault.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="CustomAspxPageDefault.aspx.cs" Inherits="CustomASPXForm" %>
<html>
<head runat="server">
<title>Untitled Page</title>
<link rel="stylesheet" type="text/css" href="<%=_cssPath+"Common/StyleSheet/Global.css"%>" />
</head>
<body leftmargin="0" topmargin="0">
<script>
//For calling the Javascript from the Workitem control
function RefreshWorkItemList()
{
if(typeof(self.opener) != 'undefined')
{
self.opener.RefreshGridfromdetwindow();
window.close();
}
else
{
top.RefreshGridfromdetwindow();
}
}
</script>
<form id="form1" runat="server">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
<table width="100%" border="0" cellpadding="4" cellspacing="1" class='tablebg'>
<tr>
<td width="32%" class="lefttdbg"><font class="subtitle">Application</font></td>
<td width="68%" class="righttdbg"><font class="description"><%=_application%></font></td>
</tr>
<tr>
<td width="32%" class="lefttdbg"><font class="subtitle">Workflow</font></td>
<td width="68%" class="righttdbg"><font class="description"><%=_workflow%></font></td>
</tr>
<tr>
<td width="32%" class="lefttdbg"><font class="subtitle">Workflow Instance Id</font></td>
<td width="68%" class="righttdbg"><font class="description"><%=_instanceid%></font>
</td>
</tr>
<tr>
<td width="32%" class="lefttdbg"><font class="subtitle">WorkItem Id</font></td>
<td width="68%" class="righttdbg"><font class="description"><%=_workitemId%></font></td>
</tr>
<tr>
<td width="32%" class="lefttdbg"><font class="subtitle">Activity</font></td>
<td width="68%" class="righttdbg"><font class="description"><%=_activityname%></font></td>
</tr>
<tr>
<td width="32%" class="lefttdbg"><font class="subtitle">Subject</font></td>
<td width="68%" class="righttdbg"><font class="description"><%=_workitemSubject%></font></td>
</tr>
</table>
</td>
</tr>
</table>
<br />
<table width="100%" border="0" cellpadding="4" cellspacing="1" class='tablebg'>
<tr>
<td width="32%" class="lefttdbg"><font class="subtitle">Activity Output</font></td>
<td width="68%" class="righttdbg"><asp:DropDownList ID="ddlStatus" runat="server" CssClass="inputselect" >
</asp:DropDownList>
</td>
</tr>
<tr>
<td align="right" colspan="2" >
<asp:Button ID="btnSubmit" Text="Submit" runat="server" class="inputbutton"/>
</td>
</tr>
</table>
</form>
</body>
</html>
CustomAspxPageDefault.aspx.cs
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class CustomASPXForm : System.Web.UI.Page
{
Skelta.HWS.WorkItem wItem;
protected Guid _workitemId = Guid.Empty;
protected string _workitemSubject = "";
protected string _activityname = "";
protected string _application = "";
protected string _workflow="";
protected string _instanceid="";
protected string _cssPath = "";
protected void Page_Load(object sender, EventArgs e)
{
//This is for getting the common folder relative path
_cssPath = Convert.ToString(Workflow.NET.TemplateExpressionBuilder.GetUrl(""));
// The Url respective to Workitem controls are secured.
// The Secured Url is getting build when we select a row from the Workitem list control using the WebWorkItemAdapter object.
// In the Custom Aspx page we need to access the workitem related details from the Secured url.
// The Processing of Secured url is achieved through the WebWorkItemAdapter object.
Skelta.HWS.WorkListChannel.Web.WebWorkItemAdapter adapter = new Skelta.HWS.WorkListChannel.Web.WebWorkItemAdapter();
//ProcessWebChannelRequest Method is used to Decrypt the Securedurl passed to the Detail Page and
//get the details related to Workitem like Applicationname,workflowname,executionid,currentworkitem etc
adapter.ProcessWebChannelRequest();
//adapter.CurrentWorkItem will give you the entire selected Workitem object details.
wItem = adapter.CurrentWorkItem;
//adapter.ApplicationName will give you the application name.
_application = adapter.ApplicationName;
//adapter.WorkflowName will give you the workflow name.
_workflow = adapter.WorkflowName;
//This is getting the Workitem id from the Workitem object
_workitemId = wItem.Id;
//adapter.CurrentWorkItem.Subject will give you the value of the Subject defined for the activity
_workitemSubject = adapter.CurrentWorkItem.Subject;
//adapter.CurrentWorkItem.Subject will give you the value of the activity display name
_activityname = adapter.CurrentWorkItem.CurrentActivity.ActionDisplayName;
//adapter.CurrentWorkItem.ExecutionId will give you the Workflow Execution Id
_instanceid = adapter.CurrentWorkItem.ExecutionId.ToString();
//To Get the Possible outputs defined for the selected activity
System.Collections.Generic.Dictionary<string, string> GetStatusList = new System.Collections.Generic.Dictionary<string, string>();
GetStatusList = ((Skelta.HWS.IHWSActivityProvider)adapter.CurrentWorkItem.HWSActivity.CurrentActivityHandler).GetPossibleStatusList();
foreach (string kvp in GetStatusList.Keys)
{
ddlStatus.Items.Add(new ListItem(kvp,GetStatusList[kvp]));
}
btnSubmit.Click += new EventHandler(btnSubmit_Click);
}
/// <summary>
/// Event for handling the Submit button
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnSubmit_Click(object sender, EventArgs e)
{
string status = ddlStatus.SelectedItem.Value;
//Submitting the Workitem
wItem.Submit("WebWorkList", status , "", "");
//Refreshing the Workitem grid after submitting the workitem
Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "RefreshGrid", "<script language='javascript'>RefreshWorkItemList();</script>");
}
}
Now, when you click any row in the Work items list, you will find this aspx page being displayed as the detailed view.