MES Employee to U8 Employee Master Data Sync: A Qeasy Hands-on Tutorial
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 Meaning | MES Source Field | U8 Target Field | Handling |
|---|---|---|---|
| Login / unique code | userName | cPsn_Num | Direct mapping, becomes U8 employee code |
| Full name | nickName | cPsn_Name | Direct mapping |
| Department | deptName | cDept_num | _mongoQuery reverse lookup by department name |
| Gender | sex | rSex | CASE WHEN 0→1 male, 1→2 female |
| Operation flag | — | Editprop | Fixed 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.
- Source configuration: Use the MES WebAPI adapter. Set the API to
system/user/list. FixpageNumto 1 andpageSizeto 100. FillwsIdandqueryKeywith the site-issued values. PickuserIdas the ID field and enableidCheck. - Target configuration: Use the U8 WebAPI adapter. Pick
BasicPerson, method POST. FixEditpropto A. Reference upstream fields through{{field}}placeholders. - Intermediate mapping: Handle gender and department in a dedicated transform node. Use
_functionfor the CASE expression on gender; use_mongoQueryto 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
userIdas a unique key in the Qeasy run log, and usecPsn_Numas 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 is1-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_Numas 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
*/5hammers 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.