Table of Contents

Class AuthorizeWorker

Namespace
Acuit.Pinpoint.Workflows.Workstation.Activities
Assembly
Acuit.Pinpoint.Workflows.Workstation.dll

Gets worker authorization for a station permission, prompting for alternate credentials if necessary, and then executes the appropriate child activity based on whether authorization was successful or not.

public class AuthorizeWorker : Activity, IActivity
Inheritance
AuthorizeWorker
Implements
Inherited Members

Remarks

If there is a worker logged onto the station, this will first attempt to authorize that worker for the specified permission at this station. If that authorization fails, then a prompt for alternate worker credentials will be shown at the station.

Constructors

AuthorizeWorker()

public AuthorizeWorker()

Properties

Authorized

Gets or sets the activity to execute if authorization is successful. If this is not set, then no action will be taken on successful authorization.

public IActivity? Authorized { get; set; }

Property Value

IActivity

Remarks

The following parameters will be provided to this activity:

  • AuthorizedWorker (type AuthorizedWorker): Information about the worker that was authorized for the permission.
  • AuthorizedWorkerBadgeNumber (type string): The badge number of the worker that was authorized for the permission.
  • AuthorizedWorkerFirstName (type string): The first name of the worker that was authorized for the permission.
  • AuthorizedWorkerLastName (type string): The last name of the worker that was authorized for the permission.
  • AuthorizedWorkerFullName (type string): The full name of the worker that was authorized for the permission. This is for convenience, and is the worker's first (if exists) and last (if exists) names concatenated with a space in between.

NotAuthorized

Gets or sets the activity to execute if authorization is not successful. If this is not set, then no action will be taken on unsuccessful authorization.

public IActivity? NotAuthorized { get; set; }

Property Value

IActivity

Permission

Gets or sets the station permission to check. This is required.

public ValueSource<string>? Permission { get; set; }

Property Value

ValueSource<string>

Methods

OnExecuteAsync(ActivityContext, CancellationToken)

Derived classes must implement this to perform the activity.

protected override Task OnExecuteAsync(ActivityContext context, CancellationToken cancellationToken)

Parameters

context ActivityContext

The activity context.

cancellationToken CancellationToken

The cancellation token used to request canceling the activity.

Returns

Task

A task that represents the asynchronous operation.

Exceptions

ArgumentNullException

context is null.

InvalidOperationException

A service required by the activity is not available, or a required activity property value is not set.

Exception

An error occurred while performing the activity.

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.

Remarks

This is expected to produce a string suitable for labeling this activity in a workflow diagram. It should be as specific as possible, but while keeping it very short. In general, it should be the short name of the class (as that is how it would typically be defined in the workflow XAML), optionally followed by other property values of interest in a diagram. The default implementation returns the short name of the class.