Click or drag to resize
RuntimeServiceGetActivityInstanceList Method
Gets a list of actions.

Namespace: Advantys.Workflow.Web.Services.Processes.Runtime
Assembly: Advantys.Workflow.Web.Services.Processes.Runtime (in Advantys.Workflow.Web.Services.Processes.Runtime.dll) Version: 5.7.14075.2 (5.7.14075.2)
Syntax
public XmlNode GetActivityInstanceList(
	string query
)

Parameters

query
Type: SystemString
Specifies the action query (Todo, Closed, TeamTodo, TeamClosed, ToAssign, Assigned, SupervisedInProgress or SupervisedClosed).

Return Value

Type: XmlNode
List of actions.

Format: By default returns RSS 2.0

Sorted: The list is sorted by actions ID in descending 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).

processName (string)Specifies the process name for mono-process mode.
processInstanceId (int)Specifies the process instance identifier filter.
processMode (string)Specifies the process mode (All, Test or Real).
delegateUsername (string)Specifies the delegate username for delegation mode.
template (string)Name of the response template.
showData (boolean)Displays the activity instance associated data content in the response output.
dataList (string)List of process data names (separated by a comma) to retrieve.
showProcessInstanceData (boolean)Displays the process instance associated data content in the response output.
sortOrder (string)Specifies the sort order (Asc or Desc).
size (int)Number of items per page.
page (int)Specifies the page number. The first page is returned if there is no page number specified.
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_LANGUAGE>Replaced with the 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_ACTIVITY_INST_LIST_LINK>Link to the Web UI portal of WorkflowGen.
<WF_ACTIVITY_INST_ITEM>Replaced with the specific sub-macros listed below.

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

<WF_ACTIVITY_INST_ID>
<WF_ACTIVITY_INST_NAME>
<WF_ACTIVITY_INST_DESC>
<WF_ACTIVITY_INST_DATE_OPEN>
<WF_ACTIVITY_INST_DATE_LIMIT>
<WF_ACTIVITY_INST_DATE_CLOSE>
<WF_ACTIVITY_INST_FORM_LINK>
<WF_ACTIVITY_INST_LAUNCH_LINK>
<WF_ACTIVITY_INST_RELDATA>
<WF_ASSIGNEE_ID>
<WF_ASSIGNEE_USERNAME>
<WF_ASSIGNEE_FIRSTNAME>
<WF_ASSIGNEE_LASTNAME>
<WF_ASSIGNEE_EMAIL>
<WF_ASSIGNEE_COMPANY>
<WF_ASSIGNEE_DEPARTMENT>
<WF_ASSIGNEE_[COLUMN_NAME]> Note: Refer to the table USERS for column name. Some columns may not be available as a macro.
<WF_PROCESS_INST_ID>
<WF_PROCESS_INST_NAME>
<WF_PROCESS_INST_DATE_OPEN>
<WF_PROCESS_INST_DATE_LIMIT>
<WF_PROCESS_INST_DATE_CLOSE>
<WF_PROCESS_INST_STATUS>
<WF_PROCESS_INST_FORM_LINK>
<WF_PROCESS_INST_RELDATA>
<WF_PROCESS_ID>
<WF_PROCESS_NAME>
<WF_PROCESS_DESC>
<WF_PROCESS_VERSION>
<WF_PROCESS_CATEGORY>
<WF_REQUESTER_ID>
<WF_REQUESTER_USERNAME>
<WF_REQUESTER_FIRSTNAME>
<WF_REQUESTER_LASTNAME>
<WF_REQUESTER_EMAIL>
<WF_REQUESTER_COMPANY>
<WF_REQUESTER_DEPARTMENT>
<WF_REQUESTER_[COLUMN_NAME]> Note: Refer to the table USERS for column name. Some columns may not be available as a macro.

Examples
Try out these URLs directly in your browser or RSS Reader.
- Return the list with RSS 2.0 format (default format when no template is specified):
http://yourserver:port/wfgen/ws/ProcessesRuntime.asmx/GetActivityInstanceList?query=Todo<br />or
http://yourserver:port/wfgen/ws/ProcessesRuntime.asmx/GetActivityInstanceList?query=Todo&template=ProcessesRuntime.ActivityInstanceListRss.txt<br />
- Return the list with ATOM format:
http://yourserver:port/wfgen/ws/ProcessesRuntime.asmx/GetActivityInstanceList?query=Todo&template=ProcessesRuntime.ActivityInstanceListAtom.txt<br />
- Return the list with a customized XML format:
http://yourserver:port/wfgen/ws/ProcessesRuntime.asmx/GetActivityInstanceList?query=Todo&template=ProcessesRuntime.ActivityInstanceListXml.txt<br />
- Return the list of team actions to do:
http://yourserver:port/wfgen/ws/ProcessesRuntime.asmx/GetActivityInstanceList?query=TeamTodo<br />
- Return 5 of my actions to do:
http://yourserver:port/wfgen/ws/ProcessesRuntime.asmx/GetActivityInstanceList?query=Todo&size=5

This HTTP GET sample returns the list of actions to do by the connected user.
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/GetActivityInstanceList?query=Todo";

        // 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 first action to do.
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;
        ActivityInstanceListHeader myActivityInstanceListHeader = null;
<br />
        // Settings and parameters
        myActivityInstanceListHeader = new ActivityInstanceListHeader();
        myActivityInstanceListHeader.Template = "ProcessesRuntime.ActivityInstanceListRss.txt";
        myActivityInstanceListHeader.Size = 1;
        myActivityInstanceListHeader.Page = 1;

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