Click or drag to resize

RuntimeServiceGetProcessInstanceCommentList Method

Gets a list of request comments.

Namespace:  Advantys.Workflow.Web.Services.Processes.Runtime
Assembly:  Advantys.Workflow.Web.Services.Processes.Runtime (in Advantys.Workflow.Web.Services.Processes.Runtime.dll) Version: 7.7.0.0 (7.7.0.0)
Syntax
public XmlNode GetProcessInstanceCommentList(
	int processInstanceId
)

Parameters

processInstanceId
Type: SystemInt32
Request ID of the comments.

Return Value

Type: XmlNode
List of request comments.

Format: By default returns RSS 2.0

Sorted: The list is sorted by posted date in ascending order.

Remarks

Optional Parameters.
These parameters can be used in the query string or as parameters of the SOAP headers (see examples for more information).

commentNumber (int)Specifies a comment number.
delegateUsername (string)Specifies the delegator username for delegation mode.
template (string)Name of the response template.
sortBy (string)Specifies the sort field (Date or Author).
sortOrder (string)Specifies the sort order (Asc or Desc).
utc (bool)Displays dateTime values in UTC format.


Common Macros

<WF_LIST_TITLE>Replaced with the title.
<WF_LIST_DESC>Replaced with the description.
<WF_SYSTEM_DATE>,<WF_SYSTEM_TIME>,<WF_SYSTEM_DATETIME>Replaced with the date, time and datetime.
<WF_USER_ID>Replaced with the user's ID.
<WF_USER_NAME>Replaced with the user's username.
<WF_USER_FIRSTNAME>Replaced with the user's first name.
<WF_USER_LASTNAME>Replaced with the user's last name.
<WF_USER_EMAIL>Replaced with the user's email address.
<WF_USER_COMPANY>Replaced with the user's company name.
<WF_USER_DEPARTMENT>Replaced with the user's department name.
<WF_USER_LANGUAGE>Replaced with the user's language.
<WF_USER_TIME_ZONE_ID>Replaced with the user's time zone ID.
<WF_USER_TIME_ZONE_NAME>Replaced with the user's time zone name.
<WF_PROCESS_INST_COMMENT_LIST_LINK>Link to the comments list in the request follow-up form.
<WF_PROCESS_INST_ID>Replaced with the request ID.
<WF_DELEGATOR_USER_ID>Replaced with the delegator's user ID.
<WF_PROCESS_INST_COMMENT_ITEM>Replaced with the specific sub-macros listed below.

Specific Sub-Macros in <WF_PROCESS_INST_COMMENT_ITEM></WF_PROCESS_INST_COMMENT_ITEM>

<WF_COMMENT_PROCESS_INST_ID>
<WF_COMMENT_NUMBER>
<WF_COMMENT_DATE_POST>
<WF_COMMENT_TITLE>
<WF_COMMENT_TEXT>
<WF_COMMENT_TAG>
<WF_COMMENT_LINK>
<WF_GEOLOC_LATITUDE>
<WF_GEOLOC_LONGITUDE>
<WF_GEOLOC_ALTITUDE>
<WF_AUTHOR_ID>
<WF_AUTHOR_USERNAME>
<WF_AUTHOR_FIRSTNAME>
<WF_AUTHOR_LASTNAME>
<WF_AUTHOR_EMAIL>
<WF_AUTHOR_COMPANY>
<WF_AUTHOR_DEPARTMENT>

Examples
Try out these URLs directly in your browser or RSS Reader.
- Return the list of request #1 comments with RSS 2.0 format (default format when no template is specified):
http://yourserver:port/wfgen/ws/ProcessesRuntime.asmx/GetProcessInstanceCommentList?processInstanceId=1<br />or
http://yourserver:port/wfgen/ws/ProcessesRuntime.asmx/GetProcessInstanceCommentList?processInstanceId=1&template=ProcessesRuntime.ProcessInstanceCommentListRss.txt<br />
- Return the list of request #1 comments with ATOM format:
http://yourserver:port/wfgen/ws/ProcessesRuntime.asmx/GetProcessInstanceCommentList?processInstanceId=1&template=ProcessesRuntime.ProcessInstanceCommentListAtom.txt<br />
- Return the list of request #1 comments with a customized XML format:
http://yourserver:port/wfgen/ws/ProcessesRuntime.asmx/GetProcessInstanceCommentList?processInstanceId=1&template=ProcessesRuntime.ProcessInstanceCommentListXml.txt<br />
- Return the comment #1 of request #1:
http://yourserver:port/wfgen/ws/ProcessesRuntime.asmx/GetProcessInstanceCommentList?processInstanceId=1&commentNumber=1<br />
- Return the list of request #1 comments sorted by author in descending order:
http://yourserver:port/wfgen/ws/ProcessesRuntime.asmx/GetProcessInstanceCommentList?processInstanceId=1&sortBy=Author&sortOrder=Desc<br />
- Return the list of request #1 comments with delegation security access from wfgen_admin:
http://yourserver:port/wfgen/ws/ProcessesRuntime.asmx/GetProcessInstanceCommentList?processInstanceId=1&delegateUsername=wfgen_admin

This HTTP GET sample returns the list of request #1 comments.
using System;
using System.Collections.Generic;
using System.Text;

namespace ConsoleApplication1
{
  class Program
  {
    static void Main(string[] args)
    {
        // Variables
        System.Net.HttpWebRequest httpWebReq = null;    // Http web request object
        System.Net.HttpWebResponse httpWebResp = null;  // Http web response object
        System.IO.StreamReader myReader = null;         // To read response stream
        string url = string.Empty;                      // URL of the web method of the API
        string response = null;                         // string used to display response

        // Call the Web Service API method (replace yourserver and port with your hostname)
        url = "http://yourserver:port/wfgen/ws/ProcessesRuntime.asmx/GetProcessInstanceCommentList?processInstanceId=1";

        // Prepare the request
        httpWebReq = (System.Net.HttpWebRequest)System.Net.WebRequest.Create(url);
        httpWebReq.Method = "GET";
        httpWebReq.Credentials = System.Net.CredentialCache.DefaultCredentials;
        httpWebReq.ContentType = "text/xml; charset=utf-8";

        // Gets the stream associated with the response
        httpWebResp = (System.Net.HttpWebResponse)httpWebReq.GetResponse();
        myReader = new System.IO.StreamReader(httpWebResp.GetResponseStream());
        response = myReader.ReadToEnd();
        httpWebResp.Close();

        // Display the XML in the console
        Console.Write(response);
    }
  }
}

This SOAP example returns with XML template, the number of comments in the request #1.
A web reference at www.mycompany.com has been added in the project.
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;
using System.Net;
using System.Xml;
using System.Xml.Xsl;
using com.mycompany.www;
<br />
public partial class _Default : System.Web.UI.Page
{
  protected RuntimeService myRuntimeService = null;
<br />
    protected void Page_Load(object sender, EventArgs e)
    {
        XmlNode resultNode = null;
        ProcessInstanceCommentListHeader myProcessInstanceCommentListHeader = null;
<br />
        // Settings and parameters
        myProcessInstanceCommentListHeader = new ProcessInstanceCommentListHeader();
        myProcessInstanceCommentListHeader.Template = "ProcessesRuntime.ProcessInstanceCommentListRss.txt";

        // Set NetworkCredentials with the credentials of the current connected user
        myRuntimeService = new RuntimeService();
        myRuntimeService.ProcessInstanceCommentListHeaderValue = myProcessInstanceCommentListHeader;
        myRuntimeService.Credentials = CredentialCache.DefaultCredentials;
<br />
        // Call the Web Service API method
        resultNode = myRuntimeService.GetProcessInstanceCommentList(1);
        TextBox1.Text = resultNode.SelectNodes("channel/item").Count.ToString();
    }
}
<br />
See Also