Support retry in M3 Export program
M3 APIs, such as the one to create a new manufacturing order, returns immediately even though M3 is still processing in the background. At this moment, if a subsequent dependent API is called to reschedule the newly created manufacturing order, the call fails because the background processing in M3 is still not completed. In order to prevent such cases, a RETRY option is introduced in the M3 Export program.
The RETRY is optional, triggered only if the underlying BOI explicitly contains the RETRY tag. The new RETRY tag has the following structure:
<RETRY>
<RETRY_ON_ERROR></RETRY_ON_ERROR>
<RETRY_MAX_NUMBER></RETRY_MAX_NUMBER>
<RETRY_FREQUENCY></RETRY_FREQUENCY>
</RETRY>
An explanation of the RETRY tag structure:
- RETRY tag is optional. It can occur 0 or 1 time in the BOI.
- RETRY_ON_ERROR is optional. It can occur 0 or * times within the RETRY tag.
- RETRY_MAX_NUMBER and RETRY_FREQUENCY are mandatory when RETRY tag exists and can occur only one time within the RETRY tag.
- RETRY_ON_ERROR: When specified, the BOI execution is repeated only if the previous call returns with the specified error(s). When not specified, the BOI execution is repeated if the previous call returns with error.
The M3 Export program follow these logic when the program encounters a RETRY tag in the BOI:
- If BULK-mode export is enabled, the BULK mode is disabled during the execution of the current BOI and switches to record-by-record mode.
- Executes the current BOI.
- If the BOI execution completes with error:
- Checks RETRY_ON_ERROR and decides if the BOI must be executed again or not. Else,the execution is stopped and an error message is displayed.
- If retry-count is less than <RETRY_MAX_NUMBER>, waits for RETRY_FREQUENCY minutes.
- Logs a message for the current task: Retrying BOI execution for <BOI>.
- Executes the BOI again. It reprocesses the record that failed and all remaining records in scope of the original execution. No new records added to scope; no records lost from the scope.
- Executes step 3 if the BOI returns with error again.
- If the RETRY logic is completed successfully, this completes the SCV Job with success.
- If the RETRY logic is completed because RETRY_MAX_NUMBER is reached, this completes the SCV Job with error.
These BOIs are updated to add a RETRY tag:
- PMS100MI_Reschedule_ST_M3_OUT_SUPPLY_PROD_PLAN_MO_RSCH
- PMS100MI_UpdOperation_ST_M3_OUT_SUPPLY_PROD_PLAN_MO_OP_UPD
This feature is enabled after appending the base for m3 template (base for m3.zip) for this version. No additional role or privilege is required to access this feature.