Click or drag to resize

RuntimeServiceUpdateDelegation Method

Updates a delegation for the current user.

Namespace:  Advantys.Workflow.Web.Services.Processes.Runtime
Assembly:  Advantys.Workflow.Web.Services.Processes.Runtime (in Advantys.Workflow.Web.Services.Processes.Runtime.dll) Version: 7.8.0.0 (7.8.0.0)
Syntax
public void UpdateDelegation(
	int delegationId,
	int processId,
	int participantId,
	int delegateUserId
)

Parameters

delegationId
Type: SystemInt32
ID of the delegation to update.
processId
Type: SystemInt32
ID of the process of the current delagation.
participantId
Type: SystemInt32
ID of the participant of the current delagation.
delegateUserId
Type: SystemInt32
ID of the delegate user of the current delagation.
Exceptions
ExceptionCondition
SoapException
Remarks

This method doesn't allow to update a delegation for another user, please refer to the Advantys.Workflow.Web.Services.Processes.Design web services for updating a delegation for another user.

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

beginDate (DateTime)Delegation begins at the specified local date time.
endDate (DateTime)Delegation ends at the specified local date time.
notifyDelegate (boolean)Notify by email the delegate user.


Examples
Try out these URLs directly in your browser or RSS Reader.
- Updates the delegation created with the AddDelegation sample with the delegate user #2
(the delegation was initially created with the delegate user #1):<br />http://yourserver:port/wfgen/ws/ProcessesRuntime.asmx/UpdateDelegation?delegationId=1&processId=1&participantId=1&delegateUserId=2

This HTTP GET sample updates the delegation created with the AddDelegation sample with the delegate user #2.
The delegation was initially created with the delegate user #1.
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/UpdateDelegation?delegationId=1&processId=1&participantId=1&delegateUserId=2";

        // 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 updates the delegation created for the connected user, the ID process #1, the ID participant #1, and the delegate user #1.
This delegation begins the 01/01/2010 at 7am and ends the 02/01/2010 at 7am.
The delegate user will be notified by email.
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)
    {
        UpdateDelegationHeader myUpdateDelegationHeader = null;
<br />
        // Settings and parameters
        myUpdateDelegationHeader = new UpdateDelegationHeader();
        myUpdateDelegationHeader.BeginDate = new DateTime(2010,1,1,7,0,0);
        myUpdateDelegationHeader.EndDate = new DateTime(2010,2,1,7,0,0);
        myUpdateDelegationHeader.NotifyDelegate = true;

        // Set NetworkCredentials with the credentials of the current connected user
        myRuntimeService = new RuntimeService();
        myRuntimeService.UpdateDelegationHeaderValue = myUpdateDelegationHeader;
        myRuntimeService.Credentials = CredentialCache.DefaultCredentials;
<br />
        // Call the Web Service API method
        myRuntimeService.UpdateDelegation(1,1,1,1);
    }
}
<br />
See Also