Querying MES Process Information: A Practical Guide to the Pull Strategy from MES to the Qeasy Middleware Layer
What This Strategy Solves
In a manufacturing supply chain integration scenario, the MES side maintains process master data (process code, process name, critical flag, workshop, and so on), which is a prerequisite for downstream strategies such as "process outsourcing request → expense purchase request." Without pre-landing this process data in the middleware layer, downstream strategies must query the source system on every run, hurting throughput and risking overload of MES endpoints during peak hours. This strategy does only one thing: on a scheduled cadence, pull MES process information into the Qeasy integration platform's middleware layer to serve as a reusable "process dictionary" for downstream strategies.
Data Flow and Field Mapping
The data flow is unidirectional: MES (source) → Qeasy middleware layer (target, the landing point for this strategy). The MES side uses the common/search WebAPI to query process records in a paginated fashion; the Qeasy side uses a "write-empty operation" as the target API, intended to land data into the Qeasy intermediate table without pushing directly to a third-party business system.
Key field mapping:
| Business Meaning | Source Field (MES) | Middleware Field (Qeasy) | Notes |
|---|---|---|---|
| Process code | processCode | Business key, used for idempotency | Process number returned by MES |
| Primary key | id | Internal key | For deduplication and incremental tracking |
| Page index | pageNum | Scheduling input | Starts from 1 |
| Page size | pageSize | Scheduling input | Empirically 100 |
| Workstation/resource id | wsId | Constant input | Dispatched by target workshop |
| Query key | queryKey | Constant input | Process category filter |
| Critical process flag | isIpsi | Business field | Marks whether the process is critical |
| Auto-fill switch | autoFillResponse | Metadata switch | Auto-fills missing fields when enabled |
How to Configure in Qeasy
In the Qeasy Data Integration Platform, the source platform for this strategy is the MES, and the target platform is Qeasy itself (write-empty operation). Typical configuration points:
- Source API selection. Choose
common/search(POST, WebAPI, QUERY semantics). Register pagination parameterspageNum,pageSize,wsId, andqueryKeyas input parameters rather than hard-coding them.pageNumshould be configured in Qeasy as "auto-increment from the last successful page." - Primary key and idempotency. Use
processCodeas the business number andidas the system key; turnidCheckoff, since the source side may contain historical dirty data. - Target API. The "write-empty operation" (EXECUTE semantics) is a shell; what really takes effect is the Qeasy intermediate table. When configuring, check "auto-create table" so that fields are mapped directly from the source response.
- Scheduling window. The source-side cron is set to
* 7-22 * * *, meaning once per minute during production hours only; the cron on the Qeasy "empty operation" side, such as1 1 1 1 1, is essentially a placeholder — what really drives execution is the source-side scheduling. - Response auto-fill. When the source side enables
autoFillResponse=true, missing fields are automatically filled with placeholders, preventing Qeasy from rejecting writes due to schema mismatch.
Implementation Steps
In real projects, we usually proceed in three phases:
Phase 1: Establish the incremental baseline. On the first day of go-live, perform a full pull using the MES's current process set as the baseline and write it to the intermediate table; thereafter, every schedule continues from the "last successful page + data fingerprint" to avoid scanning from page 1 every time.
Phase 2: Full reload trigger. In Qeasy, expose "full reload" as a manually callable entry, typically bound to 6:30 AM on weekdays (earlier than MES's peak business hours). If gaps are found in the intermediate table, operations only need to click the button to refill, without touching the strategy structure.
Phase 3: Cadence and throttling. The MES-side cron is set to * 7-22 * * * (every minute during the daytime production window). Qeasy cooperates with a sliding window: a batch every 3 minutes, 100 records per batch; nightly shutdowns leave room for MES master data maintenance.
Lessons Learned
- Hard-coded pagination key causes data loss. During the first launch,
pageNum=1was hard-coded in the request, so every minute we kept retrieving the same page, and the downstream intermediate table contained only 100 records. The safe approach is to use Qeasy's "context variable" to carry the last successful page, and only roll back to page 1 after reaching the last page. - The MES-side
autoFillResponsewas accidentally turned off. After the customer's operations team disabled this switch, some process responses had missing fields, and writes to the Qeasy intermediate table failed, accumulating alerts. The pitfall here is that this switch is source-side semantics, and Qeasy has no fallback — it must be kept on. - Wrong
wsIdwas passed. Different workshops used the samewsIdparameter, causing Workshop A's processes to be misassigned to Workshop B. The recommended practice is to makewsIdan "environment variable" in Qeasy, bound by tenant rather than hard-coded in the request body. - Downstream strategies read the source system directly. After this strategy went live, the downstream "process outsourcing → expense purchase" strategy initially still connected directly to MES, doubling MES endpoint pressure. A typical mistake is treating the middleware layer as decoration; the safe approach is to first force downstream flows through the intermediate table, and only relax later once stable.
- Nightly schedules collided with the MES maintenance window. The customer's MES performs master data batch processing from 2:00 to 4:00 AM. If scheduling doesn't stop, a large number of timeouts appear. Narrowing the cron down to
7-22is critical, and Qeasy cooperates with retry and tiered alerting.
When This Applies and When It Doesn't
Applies: MES processes, teams, production lines, and other master data need to be reused by multiple downstream strategies; high-frequency small queries need to be offloaded from MES endpoints into a centralized middleware layer; MES endpoint stability is weak and requires call throttling and caching. Doesn't apply: MES master data changes very infrequently (<10 records/day) and only one downstream strategy consumes it — letting that one strategy read the source directly is simpler; nor does it fit business requiring second-level real-time responses, because the intermediate table inherently carries minute-level latency.