Introduction
WATS can integrate with ERP/PLM systems using the REST API. A custom application or similar job is required to keep the two systems in sync.
From your ERP/PLM system you can send information about units you produce to WATS, including:
- Which phase or process the unit is in (WATS keeps a history of this).
- Which part the unit is, i.e. the part number and revision.
- Which parts the unit consists of (box build), i.e. the specific units used in assembly.
- Which batch the unit is produced in.
- Which location the unit is in now (using virtual levels in the System Manager).
In WATS this data can be used and updated in the Operator Interface or Workflow during production. A unit will go through its phases and processes in production, and other units the unit is supposed to be assembled with may change (a unit turns out faulty and is replaced). This can be updated directly in WATS and sent back to your ERP system.
To do that, a custom application or similar automated job is required. The custom application's job is to:
- Check your ERP system for changes to send to WATS.
- Get the new data and convert it to a format WATS accepts, then send it to WATS.
- Mark the changes as completed so the application knows not to send them again.
- Check for changes in WATS to send back to your ERP system.
- Get the changes and convert them back to the format your ERP system accepts.
- Mark the changes as completed in WATS.
In WATS, changes to a unit's phase, process, or parent unit is logged to a database table, and can be retrieved via the REST API. That data can then be put into your ERP system. To mark the change as complete there is another REST API method that removes the logged change from the database.
Since there are different ERP systems and the needs of each customer varies, a common synchronization application does not exits. It will have to be developed on a case by case basis.
WATS does not log unit changes by default, it needs to be enabled. To do that you need to contact support at support@virinco.com.
NOTE: The API methods described below is supported from WATS Server version 20.3.
WATS REST API methods for ERP integration
These methods require the Server Sync permission.
Adding data to WATS
PUT api/Products
This method is for adding or updating products (part numbers) in WATS. It accepts a list of products in the body, where a product is an object with these properties:
{
"partNumber": "string",
"name": "string",
"description": "string",
"state": 0,
"nonSerial": true,
"xmlData": "string",
"productCategoryId": "00000000-0000-0000-0000-000000000000"
}
partNumber is required, all other properties are optional. The properties not included or with value null will not be changed.
xmlData is a list of tags, see XML Data section.
PUT api/Products/Revisions
This method is for adding or updating revisions in WATS. It accepts a list of revisions in the body, where a revision is an object with these properties:
{
"revision": "string",
"PartNumber": "string",
"name": "string",
"description": "string",
"state": 0,
"xmlData": "string"
}
revision and partNumber is required, all other properties are optional. The properties not included or with value null will not be changed.
xmlData is a list of tags, see XML Data section.
PUT api/Production/Units
This method is for adding or updating units in WATS. It accepts a list of units in the body, where a unit is an object with these properties:
{
"serialNumber": "string",
"partNumber": "string",
"revision": "string",
"parentSerialNumber": "string",
"batchNumber": "string",
"serialDate": "2020-12-07T09:27:49.960Z",
"currentLocation": "string",
"xmlData": "string",
"unitPhaseId": 0,
"unitPhase": "string",
"processCode": "string"
}
serialNumber, partNumber, and revision is required, all other properties are optional if the unit already exists in WATS. The properties not included or with value null will not be changed. If the unit does not exist in WATS, serialDate, unitPhaseId, and processCode are also required.
The product (partNumber), revision, and batch must already exist in WATS. The parent unit (parentSerialNumber) does not need to exist in WATS yet.
xmlData is a list of tags, see XML Data section.
PUT api/Production/Batches
This method is for adding or updating batches in WATS. It accepts a list of batches in the body, where a batch is an object with these properties:
{
"batchNumber": "string",
"batchSize": 0
}
batchNumber is required, all other properties are optional. The properties not included or with value null will not be changed.
PUT api/Sites
This method is for adding factory locations (virtual levels) to WATS.
{
"code": "string",
"name": "string"
}
code and name is required.
Result
These methods returns a result object which says how many went well and how many failed, with error messages for those that failed. It has these properties:
okCount (integer)
errorCount (integer)
errors
{
identifier (string)
value (string)
errorMessage (string)
}
where identifier is the relevant id (i.e. serial number for unit, part number for product, etc.).
XML Data
Products, revisions, and units contains an XML data field. This field is used to store key value pairs (called tags) in an XML format.
XML data starts with a <Root> element. All tags are inside this element. The format of a tag is
<MyTagName Value="my tag value" />
where MyTagName is the name of the tag and the Value attribute contains the tag value.
Example:
<Root>
<Process Value="ICT" />
<StationName Value="WATSCT-006" />
</Root>
Getting changes from WATS
GET api/Production/Units/Changes?maxCount=X
This method is for checking for changes to units in WATS so they can be synced to the ERP system. You must specify a max count, which is the max amount of changes that will be returned. Keep calling this method until no changes are returned.
The return value is a list of change objects with these properties:
{
"id": 0,
"unitSerialNumber": "string"
"newParentSerialNumber": "string"
"newPartNumber": "string"
"newRevision: "string"
"newUnitPhaseId": 0
}
where unitSerialNumber is the serial number that was changed.
DELETE api/Production/Units/Changes/{id}
This method deletes a unit change from WATS. Replace {id} with the idproperty from the change you want to delete. Call this method after successfully updating the ERP system so the change isn't returned again for the next call to get more unit changes.
Comments
0 comments
Please sign in to leave a comment.