Class ApprovalBase

Contains some common functionality for approval workflows

Inheritance
System.Object
ApprovalBase
Namespace: EPiServer.WorkflowFoundation.Workflows
Assembly: EPiServer.WorkflowFoundation.dll
Version: 8.11.0
Syntax
public class ApprovalBase : StateMachineWorkflowActivity
Remarks

This base classe is not abstract since workflow designer will fail to load workflows with abstract base classes.

Constructors

ApprovalBase()

Declaration
public ApprovalBase()

Properties

SmtpFromConfigurationfile

Gets the SMTP settings from configurationfile.

Declaration
public SmtpClient SmtpFromConfigurationfile { get; }
Property Value
Type Description
System.Net.Mail.SmtpClient

The SMTP from configurationfile.

Methods

PublishPage(PageData)

Publishes the page.

Declaration
protected void PublishPage(PageData page)
Parameters
Type Name Description
PageData page

The page.

Remarks

The page will be published on behalf of the user who saved/created the version that is published. If StartPublish is set to a future date and there is already a published version of this language we dont publish the page since that would lead to that a previously published page will have none version published right now. in that case we set version to DelayedPublished meaning it will get published later when StartPublish date is reached.

RejectPage(PageReference, String)

Rejects the version of the page.

Declaration
protected void RejectPage(PageReference pageLink, string userName)
Parameters
Type Name Description
PageReference pageLink

The version that is rejected.

System.String userName

The user who rejected the version.

Remarks

The page will be rejected on behalf of the user who rejected the version.

SendApprovedEmail(SendEmailActivity, ApprovalEventArgs)

Sends an email to page owner about approved page.

Declaration
protected bool SendApprovedEmail(SendEmailActivity activity, ApprovalEventArgs approvalEvent)
Parameters
Type Name Description
SendEmailActivity activity

The activity.

ApprovalEventArgs approvalEvent

The ApprovalEventArgs instance containing the event data.

Returns
Type Description
System.Boolean

sendEmailActivity_FailedSentEmail(Object, EventArgs)

Handles the FailedSentEmail event of the sendEmailActivity control. It adds an entry to log.

Declaration
protected void sendEmailActivity_FailedSentEmail(object sender, EventArgs e)
Parameters
Type Name Description
System.Object sender

The source of the event.

System.EventArgs e

The System.EventArgs instance containing the event data.

Translate(String, String)

Helper method that tries to translate a string to a users language. If language can not be determined the first enabled language branch will be used as fallback.

Declaration
public static string Translate(string userName, string languagekey)
Parameters
Type Name Description
System.String userName

Name of the user.

System.String languagekey

The key to the item in a language xml that should be resolved.

Returns
Type Description
System.String

The translation for the given languageKey.

Iterates over all tasks related to this instance and updates pagelink

Declaration
protected void UpdateTaskLinks(PageReference newLink)
Parameters
Type Name Description
PageReference newLink