Class ScanItem
- Namespace
- Acuit.Pinpoint.Workflows.Workstation.Activities
- Assembly
- Acuit.Pinpoint.Workflows.Workstation.dll
An activity that prompts the operator to scan an item.
public class ScanItem : Activity<IItemScanner>, IActivity
- Inheritance
-
ScanItem
- Implements
- Inherited Members
Remarks
The activity will complete when either valid numbers have been scanned or typed for all numbers, or when the user has canceled by clicking the cancel button. The result value will be a IItemScanner.
When a valid number is received, and all numbers are valid, the following sequence will happen:
- The item scanner will be closed.
- If OnValid is set, it will be executed, with a parameter value provider for "ItemScanner" for a IItemScanner.
- The ScanItem activity will complete.
When the user clicks the cancel button, the following sequence will happen:
- The item scanner will be closed.
- If OnCancel is set, it will be executed, with a parameter value provider for "ItemScanner" for a IItemScanner.
- The ScanItem activity will complete.
This activity requires the IItemScanningService service (automatically provided by Acuit Pinpoint Workstation).
Properties
CancelButtonText
Gets or sets the text to show for the cancel button, or null (the default) to show the localized form of "Cancel".
public ValueSource<string> CancelButtonText { get; set; }
Property Value
ComponentTypeName
Gets or sets an optional component type name to use to determine the item scan settings.
public ValueSource<string> ComponentTypeName { get; set; }
Property Value
Remarks
If this is not set (or it evaluates to null or an empty string), then the unit scan settings for the station type will be used.
Note that this is only used to determine the item scan settings; no unit or component scan will actually be recorded for the unit.
Only component types that are configured in the list of component types for the station type can be specified.
OnCancel
Gets or sets an optional activity that executes when the user clicks the cancel button.
public IActivity OnCancel { get; set; }
Property Value
OnValid
Gets or sets an optional activity that executes when a valid number is received, and all numbers are valid.
public IActivity OnValid { get; set; }
Property Value
ShowCancelButton
Gets or sets whether to show the cancel button. This defaults to true.
public ValueSource<bool> ShowCancelButton { get; set; }
Property Value
Methods
OnExecuteAsync(ActivityContext, CancellationToken)
Derived classes must implement this to perform the activity.
protected override Task<IItemScanner> OnExecuteAsync(ActivityContext context, CancellationToken cancellationToken)
Parameters
context
ActivityContextThe activity context.
cancellationToken
CancellationTokenThe cancellation token used to request canceling the activity.
Returns
- Task<IItemScanner>
A task that represents the asynchronous operation. The value of its Result property contains the result.
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.