Qeasy Cloud
Get Started

MES Employee to U8 Employee Master Data Sync: A Qeasy Hands-on Tutorial

· 何金辉· Integration Solutions· 13 views· 4 min read

What This Strategy Solves

In one private-deployment manufacturing environment, the MES owns shop-floor personnel and scheduling, while U8 owns the financial and supply-chain personnel records. Once an employee is hired, transferred, or offboarded in the MES, the U8 personnel file must stay in sync — otherwise downstream cost accounting and permission grants break. This strategy does exactly one thing: incrementally write MES employee master data into U8's BasicPerson interface, keeping codes consistent and attributes aligned.

Data Flow and Field Mapping

The source is the MES query API system/user/list (GET, paged, 100 records per page). The target is the U8 write API BasicPerson (POST). The intermediate layer inside Qeasy handles pagination, code mapping, and field transformation.

Key field mapping table:

Business MeaningMES Source FieldU8 Target FieldHandling
Login / unique codeuserNamecPsn_NumDirect mapping, becomes U8 employee code
Full namenickNamecPsn_NameDirect mapping
DepartmentdeptNamecDept_num_mongoQuery reverse lookup by department name
GendersexrSexCASE WHEN 0→1 male, 1→2 female
Operation flag—EditpropFixed to A (add)

The cDept_num step is the classic trap: the source provides a department name while the target needs a code. A mapping table must live inside Qeasy and be queried via _mongoQuery on deptName.

Configuring This in Qeasy

In the Qeasy Data Integration Platform, this strategy is split into three steps: source query — intermediate mapping — target write.

  1. Source configuration: Use the MES WebAPI adapter. Set the API to system/user/list. Fix pageNum to 1 and pageSize to 100. Fill wsId and queryKey with the site-issued values. Pick userId as the ID field and enable idCheck.
  2. Target configuration: Use the U8 WebAPI adapter. Pick BasicPerson, method POST. Fix Editprop to A. Reference upstream fields through {{field}} placeholders.
  3. Intermediate mapping: Handle gender and department in a dedicated transform node. Use _function for the CASE expression on gender; use _mongoQuery to look up the department code. We recommend centralizing code mappings so that adding departments later means touching the mapping table only, not the source or target.

A common Qeasy pattern we use on customer sites is header/body staged delivery — this strategy only syncs the header-level personnel record. If job or shift lines are needed later, a separate A→B strategy can be layered on top.

Implementation Steps

We run the rollout in three phases:

  • Incremental baseline: First run is a full pull — page through all active users in MES and write them into U8. This becomes the comparison baseline for later increments.
  • Full trigger: Cache MES userId as a unique key in the Qeasy run log, and use cPsn_Num as the idempotency key on the U8 side so retries do not create duplicates.
  • Scheduling cadence: Source cron is */5 7-22 * * * (every 5 minutes during business hours). Target cron is 1-59/5 7-22 * * * (offset by 1 minute so both ends never hit MES in the same second). Offsetting the two schedulers is a small trick we often use on customer sites.

After one clean round, switch the strategy to incremental mode and only fetch records whose updateTime is greater than the last successful timestamp.

Pitfalls We Have Hit

  • Empty department code reverse lookup: MES stores department names in Chinese while U8 uses pure codes. The intermediate mapping table must be fully loaded before go-live; otherwise many requests resolve to an empty string and U8 rejects them. The safe move is to run a reconciliation script in Qeasy before go-live, enumerating department names on both sides.
  • Inconsistent gender semantics: MES 0/1 is the inverse of U8 1/2, and NULLs must be defaulted. A CASE expression is clearer than nested if-else.
  • Duplicate inserts: Forgetting to use cPsn_Num as the idempotency key causes every rerun to add another row with the same code in U8. Always set the code field as the unique check in the Qeasy target config.
  • Schedulers colliding in the same second: Setting both ends to */5 hammers the MES at the same instant. A one-minute offset is the cheapest fix.
  • Offboarded users not handled: The strategy only adds and updates, never disables. Add a filter in Qeasy: if the MES status is offboarded, set the U8 record to disabled instead of inserting.

When This Strategy Fits — and When It Does Not

Fits: Private-deployment MES and U8 setups where employee master data must be incrementally synced, the dataset is in the tens of thousands, and attributes like department and gender are relatively stable.

Does not fit: Scenarios where U8 needs a complex approval workflow for personnel changes, where job or shift line-level data must travel together, or where MES user counts exceed the hundred-thousand range and require streaming channels. In those cases, plan a separate strategy or move to a batch channel.

Original content. Please credit the source when reposting: https://www.qeasy.cloud/insights/solutions/strat-mes-web-u8-0201-mes-u8-71fd2cb4

Comments