Table of Contents

Workflow Events

Note

This feature is available in Acuit Pinpoint Workstation version 6.229 or later.

Overview

Workflow events allow defining, via standardized workflow definitions, custom processes that should occur in response to various events raised within Acuit Pinpoint Workstation.

Workflow Event Names

Events are identified by case-insensitive, unique names. General events might have simple names like "UnitLoaded", while events that can be raised for multiple items might have names like "NewTestRequested/Run Test" or "NewTestRequested/Hipot Test" that include the name of the item in the event name.

Workflow Event Handlers

When a custom workflow is configured as a handler for a particular workflow event, the workflow will be executed each time that event is raised.

Every workflow event that gets raised can optionally have a default workflow handler. If there are no custom workflow event handler defined for the event, then the default handler, if it exists, will execute. A custom workflow handler can optionally execute the ExecuteDefaultHandler activity as part of its workflow to execute the default handler (if one exists). This allows custom workflows to augment, instead of replace, the default handler. Also, multiple workflows can be configured for the same event name. When this happens, workflows are registered as handlers in the order they are listed in the configuration, and each workflow added becomes the new default handler for the next workflow.

Context Parameters

Depending on the context within which a workflow event handler executes, the following parameters are available for the workflow to use.

When multiple contexts are active at the same time, their relative precedence is generally in reverse order of when the context became active. For example, if a "UnitSerialNumber" shared parameter is defined in the settings, it will overridden and hide any "UnitSerialNumber" parameter value provided by the Workstation Parameters context.

Workstation Parameters

The following parameters are provided by Acuit Pinpoint Workstation, depending on the workstation state. This context is always active and has the lowest precedence of all contexts.

The following parameters are always available:

Name Type Value
LineName string The line name.
StationTypeName string The station type name.
StationName string The station name.

When a worker is logged in to the station, the following parameters are be available:

Name Type Value
Worker Worker The worker.
WorkerBadgeNumber string The worker badge number.
WorkerLastName string The worker last name.
WorkerFirstName string The worker first name.
ShiftDate DateTime The shift date.
ShiftNumber int The shift number.

When a unit is active at the station, the following parameters are be available:

Name Type Value
Unit Unit The unit.
UnitModelNumber string The unit model number.
UnitModelNumberAlias string The unit model number alias.
UnitProductionGroupName string The unit production group name, from the production schedule. If one is not defined for the unit, this parameter will exist, but will be null.
UnitScanStatus UnitScanStatus The unit scan status.
UnitSequenceNumber int? The unit sequence number in the production group. If this is not defined for the unit, this parameter will exist, but will be null.
UnitSerialNumber string The unit serial number. This will be an empty string at preassembly stations.

Shared Parameters

When the station starts up, shared parameters defined within SharedParameters Section will be made available for all workflows, in descending order of precedence:

  1. Parameters defined in the ParametersOverride section within SharedParameters Section.
  2. Unit parameters tables: Optionally, one or more Acuit Pinpoint tables can be specified from which parameter values can be looked up based on the specific unit at the station (for example, using the unit model number). These are defined via the UnitParametersTables collection within SharedParameters Section.
  3. Parameters defined in the Parameters section within SharedParameters Section.
  4. Parameters defined in the configuration section specified by the optional ConfigurationSectionName setting within SharedParameters Section.

Plug-in-provided Parameters

Plug-ins can provide their own context parameters via the IWorkflowEventManager service.

Custom Workflow Events

Plug-ins can define and raise their own custom workflow events via the IWorkflowEventManager injected interface.

Plug-ins that raise their own custom events should include a prefix in the event name to ensure the name will not conflict with any existing or future built-in Acuit Pinpoint events. For example: "MyCompany.MyEvent"

Plug-ins can also provide their own custom contextual parameters via the IWorkflowEventManager injected interface.

Acuit Pinpoint Workstation Workflow Events

The following standard events are raised by Acuit Pinpoint Workstation:

Unit Loaded

  • Event name: UnitLoaded
  • Default handler: A standard workflow derived from the station type configuration settings.
  • Additional services available to handler:

This is raised when a unit was loaded into the workstation, immediately after a successful unit scan.

New Test Requested

  • Event name: NewTestRequested/{TestTypeName}
  • Default handler: None
  • Additional parameter value sources available to handler:

This is raised when a new test of type TestTypeName has been requested to start (e.g., when the "New Test" button in the test display is clicked).

General Steps

The general steps to create and use custom workflow event handlers with Acuit Pinpoint Workstation include:

  1. If needed for your custom workflow, create an Acuit Pinpoint Workstation plug-in to contain any custom activities or services for your workflow to use. If your plug-in configures any custom services within a plug-in module (via ConfigureServices), and any of those services are used by custom workflow activities via dependency injection, then in Initialize be sure to add the module's service provider via AddServiceProvider so that the activities can be used in workflows executed via workflow events.
  2. Author your workflow defining the custom process.
  3. Deploy the files and configure Acuit Pinpoint to use them.

Workflow Parameters

Acuit Pinpoint Workstation provides the following parameter value sources to the workflow, in descending order of precedence: a parameter value is taken from the first provider listed that provides a value for a parameter with that name:

  1. Parameters defined in the ParametersOverride section within Workflow Section for the workflow.

  2. Unit parameters tables: Optionally, one or more Acuit Pinpoint tables can be specified from which parameter values can be looked up based on the specific unit at the station (for example, using the unit model number). These are defined via the UnitParametersTables collection within Workflow Section for the workflow.

  3. Parameters defined in the Parameters section within Workflow Section for the workflow.

  4. Parameters defined in the configuration section specified by the optional ConfigurationSectionName setting within Workflow Section for the workflow.

  5. The following fixed parameters:

    Name Type Value
    WorkflowEvent WorkflowEvent (or derived) The workflow event that was raised.
  6. All active context parameters. Note that this includes shared parameters defined within SharedParameters Section and custom parameter value providers registered by plug-ins via AddParameterValueProvider.

The parameters defined via key/value configuration sections can be configured via any of the methods supported by Acuit Pinpoint, such as the line configuration or in settings.json files.

Just as key/value configuration settings can be grouped into sections, so can parameters, via ParameterGroup.

Deploying and Configuring in Acuit Pinpoint

Workflow event handlers are configured for Acuit Pinpoint Workstation via EventHandler Section. Generally, the following should be done to deploy and configure the authored workflow event handler for use in Acuit Pinpoint Workstation:

  • Deploy any necessary custom plug-in(s) to the Acuit Pinpoint server.
  • Optionally, deploy the XAML workflow definition file to the Acuit Pinpoint server (see below).
  • For the station type that should use the custom process, use <settings> Element to configure these settings, choosing one of the following options:
    • Reference any custom plug-in(s) via PlugIns in Workstation Section.
    • Choose one of the following options:
      • For simple workflows, use the WorkflowXaml setting in Workflow Section to specify the XAML workflow definition entirely within the line configuration.
      • Alternatively, for more complex workflows, or to use external XAML workflow definition files that can be shared by different station configurations, use the WorkflowFile setting in Workflow Section to reference the XAML workflow definition file deployed above.

Example Configuration

<?xml version="1.0" encoding="utf-8"?>
<configuration xmlns="http://schemas.acuit.com/pinpoint/5.0/LineConfig.xsd">
  <line>
    ...
    <stationTypes>
    ...
      <stationType name="Station Type 1">
        <!-- This example embeds the XAML workflow definition: -->
        <settings>
          <setting name="Workstation:Workflows:EventHandlers:0">
            <setting name="EventName" value="UnitLoaded" />
            <setting name="Workflow:WorkflowXaml">
              <value><![CDATA[
                <Sequence xmlns="http://schemas.acuit.com/pinpoint/2020/xaml/workflows">
                  <ScanComponent ComponentTypeName="Component 1" CancelUnitWorkflowIfNoSuccess="true" />
                  <ScanComponent ComponentTypeName="Component 2" CancelUnitWorkflowIfNoSuccess="true" />
                  <ReleaseUnit />
                </Sequence>]]>
              </value>
            </setting>
          </setting>
        </settings>
      </stationType>

      <stationType name="Station Type 2">
        <!-- This example references an external XAML file containing the workflow definition: -->
        <settings>
          <setting name="Workstation:Workflows:EventHandlers:0">
            <setting name="EventName" value="UnitLoaded" />
            <setting name="Workflow:WorkflowFile" value="C:\ProgramData\Acuit Pinpoint\Acuit.Pinpoint.Server\Workflows\Custom.UnitProcess.1.0.0.xaml" />
          </setting>
        </settings>
      </stationType>
    </stationTypes>
  </line>
</configuration>