General

This is the reference for the SimpleMES Assembly module. The goal of this document is to provide in-depth details on most aspects of the module. The Groovydoc (Javadoc) API covers other details of the underlying classes, but this document explains the higher-level features and behavior.

For more information on APIs, conventions, standard fields and status codes, see the Core Reference . This assembly module conforms to those conventions.

This reference is broken up into the main object types (e.g. Domain, Service) and then sub-divided by primary package (Floor, Product, Demand, etc.).

Dashboards

A dashboard is an instrument panel that gives your users information and allows them to control some parts of your application. Typically, this dashboard allows configuration so that your users can tailor the display and behavior to their needs. These dashboards can display one or more pages in a resizable set of panels so that a lot of information can be visible to your users to operate on.

Dashboard Activities

Assembly Activity

uri: /orderAssy/assemblyActivity

This assembly activity displays the components required for the selection (order or LSN). This shows the list of required components along with their current assembly status (fully assembled, etc).

This activity is designed to work in the Scan Dashboard and with a standard Work Center Selection activity.

This activity responds to these events:

Supported Input Parameters

This activity supports some input parameters via the URL for the dashboard. The supported values include:

  • order - The order to display the assembly state for. If not given, then no data is displayed.

  • lsn - The lsn to display the assembly state for.

Assemble Component Dialog

uri: /orderAssy/assembleComponentDialog

This dialog page displays the data entry fields needed for a single component assembly. It is not a general purpose dashboard activity. This dialog triggered from the Assembly Activity.

This activity publishes these events:

Supported Input Parameters

This dialog page requires some input parameters via the URL for the dashboard. The supported values include:

  • order - The order to assemble a component for. (Required)

  • lsn - The lsn to assemble a component for (Optional).

  • component - The component to display the dialog for (component or bomSequence is Required).

  • bomSequence - The OrderBOMComponent record’s sequence for the component to assemble. If missing or 0, then a non-BOM component is assembled (component or bomSequence is Required).

  • assemblyDataType - The Flex Type that defines the data fields to collect from the user (Default: Assembly Data Type from the BOM component). This is the FlexType’s UUID.

Scan Events

The scan events are triggered by the scan processing in the MES Core ScanService . A scan event is used to tell the client to execute a specific client-side action due to some processing on the server. This includes events such as pressing a button in the GUI, refreshing due to status changes and to indicate what order/LSN was scanned.

These events are created as a ScanAction and then are automatically published as an event in the scan dashboard. See Dashboard Events for details.

ORDER_COMPONENT_STATUS_CHANGED

This scan action/event indicates that a component was assembled into or removed from an order/LSN. This is generally triggered by a scan of an encoded component for the current order/LSN in the scan dashboard.

This corresponds to server-side action AssembledComponentAction .

Event Properties

The main properties of this scan event are:

  • type - ORDER_COMPONENT_STATUS_CHANGED

  • order - The order the component was assembled into/removed from.

  • lsn - The LSN the component was assembled into/removed from (optional).

  • component - The component that was assembled/removed.

  • bomSequence - The component’s bom sequence that was assembled/removed (optional).

DISPLAY_ASSEMBLE_DIALOG

This scan action/event indicates that a the assembled component dialog should be displayed for a specific order/LSN and component. This is generally done for components that have some assemblyData to be entered. This is generally triggered by a scan of a component for the current order/LSN in the scan dashboard. This event usually displays the Assemble Component Dialog.

This corresponds to server-side action DisplayAssembleDialogAction .

Event Properties

The main properties of this scan event are:

  • type - DISPLAY_ASSEMBLE_DIALOG

  • order - The order the component to assemble into.

  • lsn - The LSN the component to assemble into (optional).

  • component - The component that should be assembled.

  • bomSequence - The component’s bom sequence (optional).

  • assemblyData - The Flex Type used to collect the data. This is the flex type’s primary key.

  • assemblyDataUuid - The Flex Type’s UUID used to collect the data.

  • firstAssemblyDataField - The name of the first assembly data field.

Domains

OrderBOMComponent

An Order BOM Component defines a single component requirement for a specific order. See OrderBOMComponent for an overview. This is stored in the core Order object in the list components.

Fields

The important fields defined for this object include:

Field Description

order

This is the order this component is needed for.(required)

sequence

The sequence this component should be displayed in. Duplicates allowed.

component

This is the Product for the component. (Required)

qty

The number of pieces required (Default: 1.0).

Archiving

This record is archived with the parent order.

OrderAssembledComponent

An OrderAssembledComponent defines a single component assembled into an order (and optionally an LSN). This includes a 'location' mechanism to track where the component was loaded from on the work center setup. This location can be a bin, shelf or automated feeder location. See Order Assembled Component for an overview of this class.

This object records the long-term component history, so there are no real primary keys for the record. No records are deleted from this table (except during order archive or other order delete scenarios). A unique sequence is assigned to each record added.

This element informally belongs to the MES Core Order parent. Since the Order is in another module, the normal child relationship notation can’t be used. Instead, this addition provides a delete check before allowing the work center to be deleted. It also provides an archive mechanism to keep the component history data long term.

The component’s history is tracked using assembly data (e.g. the supplier, lot code, date code, etc) provided by the operators. This assembly data is stored in a Flex Type based on the assemblyData Flex Type. This means the actual assembly data is stored in JSON in the field assemblyDataValues. This allows the GUIs to collect configurable data from your operators without forcing any database or other customizations.

Fields

The important fields defined for this object include:

Field Description

order

This is the order this component is assembled on (Required).

lsn

This is the Lot/Serial (LSN) within the order that this component was assembled onto (Optional).

sequence

A unique sequence for this record. This is assigned automatically.

bomSequence

The sequence from the BOM component requirement (e.g. from ProductComponent) (Default: 0).

component

This is the Product for the component (Required).

location

The location name. This is the location the component was loaded from during assembly (Default: '@')

qty

The number of pieces assembled (Default: 1.0).

assemblyData

The Flex Type used to define the assembly data for this component. The actual data is stored in a field assemblyDataValues in JSON format.

userName

The user who assembled this component (User ID). Determined from the request/session.

workCenter

The work center the component was assembled in (Optional).

state

The current state of this component (can be removed) (Default: ASSEMBLED). See AssembledComponentStateEnum

Archiving

This object is archived when the parent order is archived.

WorkCenter

A WorkCenter is a machine or location where a manufacturing operation is performed. It can also refer to the people at a location where the operation is performed.

This module adds these features to the core work center:

  • Assembly State (Setup, Down, No Setup Needed, etc).

  • Components - Loaded into locations

Fields Added

The fields added to the core object include:

Field Description

assemblyState

The status of the work center for use with assembly.

ProductComponent

A Product Component defines a single component requirement for a specific Product. See Product Component for an overview.

Fields

The important fields defined for this object include:

Field Description

product

This is the product this component is needed for (required).

sequence

The sequence this component should be displayed in. Duplicates allowed.

component

This is the Product for the component. (Required)

qty

The number of pieces required (Default: 1.0).

Services

OrderAssyService

The OrderAssyService provides methods to process assembly information on an order or LSN. This service provides the ability to assemble components and adds assembly extensions to the mes core Order logic. This includes copying component details to the order during release of the order. See MES Core Services for details on the core service.

The service methods are exposed using the OrderAssyController. These controller methods generally match the inputs and outputs of the services. The only difference is the values are passed as JSON strings.

The controller does not expose the normal CRUD (Create, Read, Update and Delete) methods that are common with domain objects. The methods provide a way to maintain all component records, but preserves the long-term history of the component setup records.

addComponent()

This method adds a component to the given order/LSN. It supports Flex Types to define customer-specific input fields for the assembled components. The component can be added for the entire order or just for a single LSN.

This method is considered part of the Stable API .

The AddOrderAssembledComponentRequest object is the main argument for the addComponent() method. This is a simple POGO that you must populate before you call the method.

Field

Description

order

The Order the component is to be assembled on (Required).

lsn

The LSN the component is to be assembled on (optional).

bomSequence

The OrderBOMComponent from the order’s list of components (Optional).

component

The component Product to be added to the order (Required).

workCenter

The Work Center the component is to be assembled in (Optional).

location

The location that the component is to be assembled from. This could be a bin location in the work center (default: '@').

qty

The number of pieces to assemble. Will use the component.qty if provided in the input. (Default: 1.0).

assemblyData

The FlexType used to define the assembly data for this component. See Flex Types for details (Optional).

This method returns the The OrderAssembledComponent created for this request.

To handle assembly data values from the flex type, you must provide the assemblyData element in the JSON input (via the controller) first. This can be the flexType key field or its UUID.
JSON Example

To add a component using JSON via the controller, use this request POST request:

uri: /orderAssy/addComponent

The JSON content passed to the controller contain the component to add:

JSON Add Component
{
  "order": "M1001",
  "lsn": {
    "lsn": "SN2037"
  },
  "component": "CPU",            (1)
  "location": "BIN 47",
  "workCenter": "CELL_17",
  "qty": 47.2,
  "assemblyData": "VENDOR",      (2)
  "LOT": "ACME-101"              (3)
}
1 The component is a reference to a product domain record.
2 assemblyData is a Flex Type. This must come before the field values.
3 The LOT assembly flex type supports a single data field 'LOT'.

findComponentAssemblyState()

This method finds the state of all the components needed for the given order/LSN. If LSN is given, then the logic will attempt to reconcile order-based components with this single LSN. This will cause problems when mixing order-based and LSN-based assembly for a given component. Typically, this will report a fully assembled component for LSN when it is uncertain.

This method does no pagination or filtering, but it does sort by sequence. This method supports Flex Types to define customer-specific input fields for the assembled components.

The request is a FindComponentAssemblyStateRequest with these elements:

Field

Description

demand

The order/LSN to find the components for.

hideAssembled

If true, then all components that are fully assembled or over assembled will be filtered out (Default: false).

This method returns a list of The OrderComponentState objects that can displayed in GUIs. This object includes a number of display values, that are localized by the request’s locale.

JSON Example

To find the current components on an order or LSN, you perform a GET request on:

uri: /orderAssy/findComponentAssemblyState?order=M1001&format=json

The response is a map with the total number of rows available and a list of the OrderComponentState’s.

JSON findComponentAssemblyState() Response Example
{
  "total_count": 2,
  "fullyAssembled": false,
  "data": [
    {
      "sequence": 10,
      "component": "SEAT",
      "componentAndTitle": "SEAT (Seat)",
      "location": "@",
      "qtyAssembled": 0.0,
      "qtyRequired": 1,
      "assemblyData": {
        "flexType": "Vendor",
        "uuid": "5984873b-4a03-4262-abf5-4817a876edb1"
      },
      "overallStateString": "Empty",
      "overallState": "EMPTY",
      "_overallStateDisplay_": "Empty",
      "percentAssembled": 0,
      "qtyAndStateString": "0/1 Empty",
      "canBeRemoved": false,
      "canBeAssembled": true,
      "_complexCustomFields": null
    },
    {
      "sequence": 20,
      "sequencesForRemoval": [
        1
      ],
      "removalLabels": [
        "Component :WHEEL-27 Qty: 2 - <b>Vendor</b>: ACME"
      ],
      "component": "WHEEL-27",
      "componentAndTitle": "WHEEL-27 (27\" Wheel)",
      "location": "@",
      "qtyAssembled": 2,
      "qtyRequired": 2,
      "assemblyData": {
        "flexType": "Vendor",
        "uuid": "5984873b-4a03-4262-abf5-4817a876edb1"
      },
      "assemblyDataAsString": "<b>Vendor</b>: ACME",
      "overallStateString": "Full",
      "overallState": "FULL",
      "_overallStateDisplay_": "Full",
      "percentAssembled": 100,
      "qtyAndStateString": "2/2 Full",
      "canBeRemoved": true,
      "canBeAssembled": false,
      "_complexCustomFields": null,
      "_fields": null,
      "VENDOR": "RRRR"
    }
  ]
}

removeComponent()

This method removes a component from the given order/LSN. The component can be added for the entire order or just for a single LSN. This requires the use of the unique sequence number from OrderAssembledComponent record. The API call is the same for an LSN (no LSN argument is needed).

This method simply marks the record as Removed and records the user and date/time of the removal. This method is considered part of the Stable API .

The RemoveOrderAssembledComponentRequest object is the main argument for the removeComponent() method. This is a simple POGO that you must populate before you call the method. Also, these arguments can be passed from input fields or as HTTP parameters if needed.

Field

Description

order

The Order that the component was assembled on (Required).

sequence

The unique sequence from the OrderAssembledComponent record to mark as removed (Required).

This method returns a map with these elements:

Field

Description

orderAssembledComponent

The OrderAssembledComponent that was marked as removed for this request

infoMsg

The user-readable message that indicates the component removed.

undoActions

The list of undo actions to undo this removal.

JSON Example

To remove a component using JSON via the controller, use this request POST request:

uri: /orderAssy/removeComponent

The JSON content to remove the component is:

JSON Remove Component
{ "removeOrderAssembledComponentRequest": {
    "order": "M1001",
    "sequence": 247
  }
}

undoComponentRemove()

This method reverses the component removal. This simply marks the record as Assembled and clears the user it was removed by and clears the removed date. This requires the use of the unique sequence number from OrderAssembledComponent record. The API call is the same for an LSN (no LSN argument is needed).

This method simply marks the record as Assembled and then it clears removed by user and date/time of the removal. This method is considered part of the Stable API .

The ComponentRemoveUndoRequest object is the main argument for the undoComponentRemove() method. This is a simple POGO that you must populate before you call the method. Also, these arguments can be passed from input fields or as HTTP parameters if needed.

Field

Description

order

The Order that the component was assembled on (Required).

sequence

The unique sequence from the OrderAssembledComponent record to mark as removed (Required).

This method returns the The OrderAssembledComponent that was marked as assembled for this request.

JSON Example

To restore a removed component using JSON via the controller, use this request POST request:

uri: /orderAssy/undoComponentRemove

The JSON content to restore the removed component is:

JSON Undo Remove Component
{ "componentRemoveUndoRequest": {
    "order": "M1001",
    "sequence": 247
  }
}

ScanAssyService

The Scan Assy Service supports scanning of assembly information in the Scan Dashboard . This service adds extensions to the core ScanService.scan() method to identify component barcodes as scanned by the operator. These scans will provide almost all of the information needed to assemble components.

The groovy doc is ScanAssyService .

Method Extensions

Some core methods of the ScanService are extended to support the new features. These include:

  • postScan() - Basic scan logic. Handles component scans.

  • postGetBarcodePrefixMapping() - Defines the Barcode Prefixes supported. Adds Product, Vendor, Lot and Serial.

For more details on general barcode formats, see Barcode Formats .

Do not call these extension methods directly.

Barcode Prefixes

Some barcodes can include multiple values such as the Product and Lot code. Using the internal (simple) format, this barcode might look like this:

^PRD^WHEEL-27^LOT^20171101-18

This module adds several types of barcode prefixes to the standard scan capability. The new barcode prefixes added for assembly include:

Prefix

Meaning

Description

PRD

PRODUCT

A product or component.

VND

VENDOR

The vendor that provides a component.

LOT

LOT

The component lot code used.

SN

SERIAL

The serial number for the component.

Table 1. ASCIIDOCTOR Attributes

asciidoctor-version

2.0.10

safe-mode-name

unsafe

docdir

/home/runner/work/simplemes-core/simplemes-core/mes-assy/src/main/docs/asciidoc

docfile

/home/runner/work/simplemes-core/simplemes-core/mes-assy/src/main/docs/asciidoc/reference.adoc

doctype

book

imagesdir-build

images

imagesdir-src

images

imagesdir

images