Custom Actions in the AgilePoint Process Instance List Web Part

This section provides the steps to design and configure Custom Actions in the AgilePoint Process Instance List Web Part:

  1. Code the Custom Actions.

    The user defined custom class needs to be derived from ICustomProcessInstanceAction and needs to implement the AddCustomActions method.

    Sample:

    public class CustomTaskListActions : ICustomProcessInstanceAction
            {
            public StringBuilder AddCustomActions(StringBuilder sb, string piid, string currentUser)
          {
          int count = 0;
          string formRenderUrl = "FormRender.aspx";
          formRenderUrl = formRenderUrl + "?PIID=" + piid;
          sb.Append(AddMenuItem(count.ToString(), "window.open('" + formRenderUrl + "')", "_layouts/images/edit.gif"));
          return sb;
          }
          
          private string AddMenuItem(string text, string actionUrl, string imageUrl)
          {
          if (imageUrl == null || imageUrl == string.Empty)
          {
          imageUrl = "/_layouts/AP/Image/warn16.gif";
          }
          string menuHtml = "<ie:menuitem id=\"" + Guid.NewGuid().ToString() + "\" type=\"option\" iconSrc=\"" + imageUrl + "\" onMenuClick=\"" + actionUrl + ";\" text=\"" + text + "\" title=\"" + text + "\" menuGroupId=\"2147483647\"></ie:menuitem>";
            return menuHtml;
            }
            }
  2. Build and drop the assembly in the GAC and the bin directory of the SharePoint Web application.
  3. Configure the Custom Action in the AgilePoint Process Instance List Web Part:

    This can be done in two ways:

    • Registering the custom assembly in the GAC. Add a new setting in the appSettings node with the key as “CustomProcessInstanceAction” and the value as “Class name, Assembly name”.

      For example:

      <add key="CustomAgilePointTaskActions" 
        value="SPCustomAction.CustomTaskListActions,SPCustomAction" />
    • Registering the Custom Assembly in the AgilePoint Configuration List.

      Add a new item in the AgilePoint Configuration List where the Application name is CustomProcessInstanceAction and the AP Setting Value is class name, assembly name