Introduction

This module provides assembly related functions to the Core SimpleMES application. If this module is used with the deployed application, then users may define Bills of Material (Product Component (BOM)) and setup WorkCenters to perform assembly when manufacturing products.

This MES is built on the Enterprise Framework . Many of the features described here are fully documented by that plugin.

Dependencies

This plugin module requires the Core SimpleMES , which in turn requires a number of other plugins, such as the Enterprise Framework .

The only dependency you have to include in your build.gradle file is the core module:

Example Gradle Dependency
dependencies {

  . . .

  compile "org.simplemes.plugins:mes-core:+"

}

This will add any required plugins to your application.

Packages

This module works with the core MES module, which is located under the package org.simplemes.mes. To avoid conflicts with other modules, the assembly module is located under the package org.simplemes.mes.assy.

The basic package layout is:

packages
Figure 1. Assembly Package

All classes provided by this Assembly module will be under the org.simplemes.mes.assy package. The packages under this package will mirror the mes core structure (e.g. shop floor extensions will be in the floor sub-package. Product extensions will be in the org.simplemes.mes.assy.product package.

Module Features

The sections below will give an overview of the main features provided by this module. The specific details will be covered in detail in the reference document.

Assembly

Dashboards Scan Support

This Assembly module is used to identify components that are added to Orders or LSNs in production. Reports provide a way to identify the components used in your shipped products. This can be very useful to help identify product recall issues, perhaps years after production.

Additions to MES-Core

This module makes a number of additions to the core MES module. This addition adds related domain classes to support logging of components assembled into orders and LSNs. See Data Model for details.

Product Addition

This module adds features to the core Product objects to support assembly of components into orders/LSNs. This includes definition and production actions using the Product Component (BOM) custom domain.

Components Required (BOM)

This module also adds a list of components needed to produce a Product. This custom child object (Product Component (BOM)) is used to determine what components are needed to produce an order.

Assembly Data Type

The overall Assembly module adds a new field to the core Product definition. This defines the flex data fields needed for a component when it is assembled. For example, it might include a lot number from a supplier.

This is used whenever a component is assembled by the user. This includes manual assembly and scanner-based assembly.

Order Addition

This module adds logic to to the core Order features to support assembly of components into orders.

Order Release

This module adds logic to the core OrderService.release() logic to copy the Product components to the order. These records are a simple copy of the Product Component (BOM) records for the Product.

This module also provides additional assembly-related methods in the Order Assy Service. This includes reading, adding and removing components for the order/LSN.

Component Assembly

This module adds the Order Assy Service to support assembly of components into an order/LSN. This records the historical components used on the order as well as the current components.

Scan Support

The core Scan Dashboard provides a way to quickly process work on the shop floor using a simple barcode scanner. It provides ways to start and complete and order/LSN in a scan-oriented dashboard:

dashboardAssy
Figure 2. Scan Assembly Dashboard

This Assembly module adds support for scanning components for assembly. This includes these types of barcodes:

  • Component with assembly data (Serial Number) in a formatted barcode.

  • Component scan, followed by one or more assembly data scans.

See Barcode Prefixes for details on encoding multi-part barcodes. A sample barcode using the internal format is:

^PRD^WHEEL-27^VND^ACME_WHEELS^LOT^200171023

This defines the values:

  • Product component: WHEEL-27

  • Vendor: ACME_WHEELS

  • Lot: 200171023

The assembly addition to the Scan logic can assemble this component/lot automatically for an order using a single scan.

For automatic handling of the component scanning, you must meet the following conditions:

  • The Order should have a BOM (the Product has a BOM).

  • The Product has defined an assemblyDataType.

  • The barcode combines the product and the assembly data needed (e.g. a Lot Code). See example above.

Assembly Scan Flow

The basic flow for a structured barcode (e.g. ^PRD^WHEEL…​) is:

  1. If the core logic has resolved the scan, then do nothing.

  2. Extract the component scanned and any assembly data (e.g. lot).

  3. If the component’s product has an assembly data type that does not match ANY field in the barcode, then a dialog is displayed on the client to collect the assembly data.

  4. If the component is a valid Product, add the component to the order/LSN with the barcode’s assembly data. If the component is not found in the BOM, then the component is assembled as a non-BOM component.

If the component is listed multiple times in the order’s BOM, then the first un-assembled component is used. Once the full quantity is assembled, any excess will be assigned to first matching component.

If the component’s product has an assembly data type, then only the barcode’s fields that match the flex type’s fields are logged in the assembly record.

The basic flow for a simple barcode (e.g. WHEEL) is:

  1. If the core logic has resolved the scan, then do nothing.

  2. If the scanned value is not a Product, then no action is taken.

  3. If the scanned value is a Product with no assembly data to collect, then the component is assembled without the data. If the component is not in the BOM, then it is assembled as a non-BOM component.

  4. If the scanned value is a Product with assembly data to collect, then a dialog is displayed on the client to collect the assembly data. See Assembly Scan Activity for details.

LSN Use

If you are assembling using LSNs, then most of the assembly logic assumes you will use LSNs for the same component in a given order. You can mix order and LSN-based assembled in different components all you want.

You should not mix modes for a single component. If you do, then the detection of already assembled components will be inconsistent. In most cases, the detection of already assembled components will ignore the order-based quantities.

No BOM

If the order’s product has no BOM, then assembly is still possible. If you scan a component barcode, then assembly will take place. No BOM requirement will be fulfilled.

Assembly Reports

One of the most important features of assembly is the ability to find what orders/LSNs used a specific component. This is needed for recall purposes and for some governmental regulations. SimpleMES provides a full-text search mechanism to let you find specific orders/LSN that use a given component. The main starting point for this is the Component Report. This component report provides links to the detailed Order/LSN Assembly Report.

Searching

SimpleMES will index all assembly data entered by the operators. This allows a full-text search on the data collected during assembly. Typically, this will include data collected for the assembly data type (a flex type) fields. For example, you might collect a LOT and VENDOR during the assembly process. If you want to find all orders that used anything with the text '65028937-011', then you could search with:

65028937-011

This would find any order that has the text '65028937-011' in its data. This could match things other than the LOT. To limit your search to just the LOT field, you could search with:

assy.lot:65028937-011

This will find just records that have the value '65028937-011' in the Flex Type field LOT.

The text 'lot:' is a simple short-hand that is expanded into the correct search term. The report will show the actual search term used.

Flex Type Field Names - Uppercase or Lowercase?

The Search Engine and the Postgres JSON SQL queries use the flex type field names in case-sensitive queries. If you define a field name as 'LOT' and then try to query on 'lot', then the values won’t be found.

You should make sure you use a consistent field naming convention. In particular, make sure to use the same case for all field names. Use all upper case, all lower case or consistent mixed case.

Component Report

When you need to find the orders/LSNs that used a given component lot, this report is the best starting place for your search. This report will perform a full-text search for any text entered. It also supports the syntax for searching on just a single flex type field (e.g. 'lot:65028937-011').

The orders/LSNs found with the component will be displayed in a simple list with a hyper-link to the detailed Order/LSN Assembly Report.

componentReport
Figure 3. Component Report

Order/LSN Assembly Report

This report shows the detail assembly data for the given Order/LSN. This can include any removed components. The important assembly information shown includes the user, date of assembly and the component details.

orderAssyReport
Figure 4. Order/LSN Assembly Report

Data Model

Core/Framework Domains LSN Order Product Routing Work Center Flex Type

This module provides assembly-related domains such as BOM and additions to core domains such as Work Center.

Diagrams

There are a number of object diagrams to show you the relationships between various objects. These follow a general shape and color scheme as shown below:

ColorLegend

Order BOM Component

Most orders will be built with components of some sort. The required components are pre-defined in the Product . These are copied to the order upon release so each order has its own specific list of components required. These are stored in the OrderBOMComponent domain class.

The Order Assembled Component tracks the actual components assembled into the order. This includes optional details on the source of the components (e.g. vendor and lot).

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 module maintains the relationship between the component and order records. It also provides an archive mechanism to keep the component requirement data long term.

Archiving

This object is archived when the parent order is archived.

Order Assembled Component

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. These are stored in the OrderAssembledComponent domain 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.

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.

Order/LSN/Component Relationship

This component history is associated with an Order and optionally with an LSN. This means you can track component usage at the order level or at a lower level for the individually unit or lot (LSN).

orderLsnComponentRelationship

The OrderAssembledComponent domain is loosely linked to an Order and an optional LSN. This means component can be assembled as a lot assembled into a lot, or a serailized component assembled into a specific unit (LSN).

Archiving

This object is archived when the parent order is archived.

Product Component (BOM)

The ProductComponent a single component requirement for a specific Product. A Bill of Material (BOM) is a list of the components needed to build a given product. This BOM can contain manufactured or purchased products as components for the manufactured product.

Components are just another product that is assembled into a final product. These can be manufactured or purchased from an outside supplier.

The BOM is added to the core MES Product GUIs by this module. It allows you to define which components (other products) that must be assembled to make an assembly. This includes the quantity required.

The BOM is stored in the ProductComponent domain class, which is a custom child list extension to the core Product domain.

LSN

An LSN (Lot/Serial) a single order.

This LSN is provided by the core MES module.

Order

A single order from a customer to produce a quantity of a product. This is sometimes known as a job or shop order.

This Order is provided by the core MES module.

Product

A Product is a part or object that is produced on your shop floor or purchased from external sources. This is sometimes known as a part number or model number.

This Product is provided by the core MES module.

This module adds the Product Component (BOM) child list to the Product domain to track the required components for a product.

Routing

A Routing is a sequence of operations needed to manufacture a Product. These operations can be simple actions such as ASSEMBLE or TEST. They may also be a composite operation that is made up of several actions that are not tracked within SimpleMES.

This module adds a new flag to the RouterOperations to control when automatic assembly is done on processed Orders or LSNs:

`assemblyMode` - The auto assembly mode to be used for this operation.

This is am AssemblyModeEnum .

When the assemblyMode is set to anything other than NONE, the start() or complete() methods will automatically assemble the appropriate components from the work center’s components into the order or LSN.

Work Center

A Work Center 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 assembly module provides additions to the core Work Center domain and services.

This assembly module provides:

  • Assembly Setup

Flex Type

Provides user-defined data types. The framework supports these user-defined fields directly using Flex Types .

The user-defined field values are stored in a large string column in the database as JSON.

Services

Introduction

This MES Assembly plugin provides most of the business logic of assembly as services. These services use the domain objects to affect the persistent state of objects.

See the MES Core Services for an overview of how the domain objects and services interact. This includes working with input arguments and database transactions.

Order Assy Service

The Order Assembly Service 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.

addComponent()

The addComponent() 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.

JSON Example - addComponent()

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()

The findComponentAssemblyState() 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.

postRelease()

This method is called after an order is released by the mes-core module. This addition method will copy any ProductComponent (BOM) records to the order.

Do not call this directly. Call the mes-core OrderService.release() method instead.

removeComponent()

The removeComponent() method removes a specific component from the given order/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.

JSON Example - removeComponent()

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

uri: /orderAssy/removeComponent

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

JSON Remove Component
{ "removeOrderAssembledComponentRequest": {
    "order": "M1001",
    "sequence": 247           (1)
  }
}
1 Every assembled component record for the Order has a unique sequence. This value must be used to remove it.

undoComponentRemove()

The undoComponentRemove() reverses the component removal. This simply marks the record as Assembled. 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).

JSON Example - removeComponent()

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

uri: /orderAssy/undoComponentRemove

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

JSON Undo Component Remove
{ "componentRemoveUndoRequest": {
    "order": "M1001",
    "sequence": 247           (1)
  }
}
1 Every assembled component record for the Order has a unique sequence. This value must be used to remove it.

Scan Assy Service

The ScanAssyService 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.

See MES Core Services for details on the core service.

The scan service methods are not exposed by any controller in this module. The module relies on the core scan controller to provide access. This module does provide data entry activities for component assembly and the related controller.

The easiest component barcode for the operator to work with is the formatted barcode that contains the component and the lot/serial number to assemble. This is typically used to assemble purchased products with multi-part barcodes labels.

Using the simplest internal format, an example barcode looks like this:

^PRD^WHEEL-27^VND^ACME_WHEELS^LOT^200171023

This will assemble the component WHEEL-27 from the vendor ACME_WHEELS with the lot code 200171023. When scanned with a current order/LSN in the scan dashboard, this module will auto assemble the component into the order.

This example uses the simple internal format for multi-part barcodes. For supported barcode formats, see Barcode Formats .

See Barcode Prefixes for details on encoding multi-part barcodes for assembly-related data.

This assumes the a Flex Type that requires a vendor and lot code is defined for the WHEEL-27 product.

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/guide.adoc

doctype

book

imagesdir-build

images

imagesdir-src

images

imagesdir

images