Interface that usercontrols associated with a task should implement. The control can e.g. communicate with a custom event activity.

Namespace:  EPiServer.WorkflowFoundation.UI
Assembly:  EPiServer.WorkflowFoundation (in EPiServer.WorkflowFoundation.dll) Version: 6.0.530.0

Syntax

C#
public interface IWorkflowTaskControl

Remarks

To communicate with a custom event activtiy a custom service should have been registered with ExternalDataExchangeService in workflow runtime. This can be done in web.config (under section externalServices) or through API

Examples

Shows a sample implementation of interface
CopyC#
private PageReference _pageLink;
/// <summary>
/// Gets input from user and invokes event on custom service. That is a custom
/// event based activity will be called.
/// </summary>
public bool InvokeEvent(Guid workflowInstanceId, int taskId, string eventQualifiedName)
{
    //Get currentuser
    string currentUser = (System.Web.HttpContext.Current != null && EPiServer.Security.PrincipalInfo.Current != null) ?
            EPiServer.Security.PrincipalInfo.Current.Name : string.Empty;

    Task task = Task.Load(taskId);

    //Invoke event on service
    ApprovalService service = (ApprovalService)WorkflowSystem.WorkflowManager.GetService(typeof(ApprovalService));
    service.InvokeApprovalEvent(
        new ApprovalEventArgs(
            Approved.Checked, 
            currentUser, 
            task.AssignedTo, 
            Message.Text, 
            workflowInstanceId,
            _pageLink));

    //Delete task if it was a personal task, if it was assigned to a group don't delete it
    return !task.AssignedIsRole;
}

/// <summary>
/// Will be called at startup of the control to sets the context for the task. Initialize controls.
/// </summary>
public void ContextData(Guid workflowInstanceId, int taskId, string eventQualifiedName, PageReference pageLink)
{
    _pageLink = pageLink;
    History.WorkflowInstanceId = workflowInstanceId;
    HistoryPanel.DataBind();
}

/// <summary>
/// If the page loaded beside actionwindow (that is in editpanel) is changed while
/// this control is loaded the framework will at postback update with the new
/// loaded page.
/// </summary>
/// <param name="previousPageLink">The previous page link.</param>
/// <param name="newPageLink">The new page link.</param>
public void PageHasChanged(PageReference previousPageLink, PageReference newPageLink)
{
    _pageLink = newPageLink;
}

/// <summary>
/// If null or string.Empty is returned, default text "Send" (language dependent) is used
/// </summary>
public string InvokeButtonText
{
    get { return string.Empty; }
}

See Also