Skip to content

MDMCS MDREST4i Interface

Published September 3, 2025


Overall Setup Steps

Step Actions
1 Add library MDRST to any MDCMS level JobD where an API or Consumer will be compiled/promoted.
2 In SDK Documenter, Create an Environment in SDK Documenter for each MDCMS level.
3 Create an MDCMS attribute (e.g., OAPISDK) for type *DUMMY for each level/environment where APIs/Consumers will be promoted to.
4 Add the command MDRCPYOAPI as a command to each MDCMS level/attribute.
5 In the SDK Console → Edit Site dialog (1) edit the following:
6 In MDCMS Values, select Object Required.
7 In MDCMS Base, add the host name of the MDCMS REST API server
8 In MDCMS API Token add your token from the MDSEC Token system.
9 In OAPI Attribute add the MDCMS Attribute you created for OAPI promotions.

SDK Data Architecture and Flow

Below is a simplified flow of what the MDCMS interface maps in MDCMS Object requests. Depending on hwo you configure the MDCMS Config in the SDK Edit SIte UI, it will send two or three Object Requests to MDCMS.

MDCMS Interface Flow

MDCMS Interface Flow

More info on how MDRest4i SDK stores and process the OAPI specification

Create an Environment in SDK Documenter

Step Action
1 alt text Login as an administrator to MDRest4i Documenter. MDRest4i Documenter is on the same server as the SDK and can be accessed directly using this URL: http://youribmi:yourport/docu/, or from the "Developer Portal" link in the header of the SDK Web UI.
2 Click the user avatar alt text on the top right-hand side and select Admin.
3 alt From the Administration page, switch on the MDCMS option.
This makes the Installation Details tab appear for a Specification (values are added by MDCMS when the OAPI is promoted).
4 alt From Administration, select the Environments → Go button.
5 alt From the Environments list screen, select the Add icon (top right).
6 alt text Name Create a Name for the environment.
REFFUID This value is auto created as you type the environment name above.
Note/copy and save this for the next step in MDCMS when adding the MDRCPYOAPI command to the MDCMS Attribute.
Seq. Number: This value sets the order that an environment will be listed in the left hand Documenter menu
Select Add to save the Environment details.

Create MDCMS Attribute for OAPI Specifications

In MDCMS, add an Attribute:

MDCMS Attribute example for OAPI Specification promotion
 MDCCMEM                          T86 Dev/Test                          1.09.25
 SCRN2                         Attribute Record                        16:01:31

 Application/Level . .  APIS   100                          Commands........: Y
 Object Type . . . . .  *DUMMY      System or MDCMS Type    Scripts.........: N
 Object Attribute  . .  OAPISDK                             Linked Checkouts: N
 Description . . . . .  OAPI from SDK to DOCU                                  

 Object Library  . . .                                                         
 Source File . . . . .              *IFS, *REQONLY, File                       
   Library . . . . . .                                               *TEMP, Lib



 Require Approval  . .  N           N=Use Level Def, T=Template, Y=Yes         
 Dft Compile Sequence   17                                                     
 Acceptance Group Type                                                         
 Ignore Dependencies .  N           Y/N                                        

 Enter=Confirm   F2=Full Name                                                  
Parameter Description
Application As per your current setup
Example: APIS
Level As per your current setup
Example: 100
Object Type *DUMMY
Object Attribute Any appropriate name
Note: This attribute is entered in the OAPI Attribute field of the SDK Console Setup for MDCMS Interface
Example: OAPISDK
Description Any suitable description
Example: `MDRest4i OAPI Docs
Ignore Dependencies Y

Add Attribute Command MDRCPYOAPI

Take option "C" to add a command to the Attribute created above.

MDCMS Attribute Command for OAPI promotions
 CMCCMST                         T86 Dev/Test                          25.08.25 
 SCRN2                  MD Default Command Maintenance                 09:05:33 

 Appl/Lvl.: APIS   100  Desc: Promote from SDK to DOCU ENV                      
 Attribute: OAPISDK     *gen*, *RFP, *ALL     Run for Modifications: Y  Y/N     
 Type.....: 2  Pre-Installation                       Recompiles...: Y  Y/N     
 Sequence.:                                           Deletes......: Y  Y/N     
 Frequency: O  O=Object, R=RFP                        Updates......: Y  Y/N     
 User Prof: *USER                             Ignore Errors........: N  Y/N     
 Obj Type.: *ANY        *ANY, type            Keep MD Libs in Libl.: Y  Y/N     
 Spec Def.: Y  Y=Run if specific def exists                                     

Command                                                                         
MDRCPYOAPI ENTITY(##OBJNAM##) USER(##OBJREQ##) FROM(*SDK) TO('APIS-100')        
REMOVE(Y) OVRWRT(Y) INSTDT('##RFPIND##') RFPNBR(##RFPNBR##) APP(##APPLIC##) 
LVL(##PROLVL##) PROJ(##PROJID##) TASK(##TASKID##) STASK(##STSKID##) INST(*DFT) 
LOCT(DEV)                                                                            
_______________________________________________________________________________
_______________________________________________________________________________

 F4=Browse   F7=Insert Placeholder   F12=Previous

Use command MDRCPYOAPI – MDRest4i Copy OAPI Specs to copy data between the SDK tables used to store the OAPI specs.

MDRCPYOAPI Parameter Reference

Parameter MDCMS Wildcard Description
ENTITY ##OBJNAM## The name given to the specification by the user with spaces.
Example: a-client-list
USER ##OBJREQ## Supply the username of the user who created the specification in the SDK, e.g., STUART.
FROM na Where the OAPI specification record is to be copied from.
Either *SDK - When the OAPI is to be copied from the users SDK sandbox (Specs that are in the users Specification List in the SDK UI)
or
<environment-name> Documenter Environment where the OAPI is to be copied from. Such as when an OAPI/API is being promoted between MDCMS APPL/LVL environments e.g. APIS-100APIS-200
TO na Where the OAPI specification record is to be copied to.
Either *SDK - When the OAPI is to be copied to the users SDK sandbox (Specs that are in the users Specification List in the SDK UI)
or
<environment-name> Documenter Environment where the OAPI is to be copied to. Such as when an OAPI/API is being promoted between MDCMS APPL/LVL environments e.g. APIS-100APIS-200
REMOVE na This specifies whether to remove the OAPI Specification from the "FROM" record.
Y = Remove the source record.
N = Leave the source record in place
OVRWRT na This specifies whether to overwrite an existing OAPI Specification in the "TO" record.
Y = Overwrite the destination record.
N = Leave the destination record in place and fail the promotion if the record already exists
INSTDT ##RFPIND## Supply the date, e.g., 30.01.2023.
NOTE: This must be in single quotes if separators are used, such as when MDCMS replaces values using replacement values such as '##RFPIND##'
RFP number ##RFPNBR## Supply the RFP number, e.g., 333333.
App ##APPLIC## Supply the app name, e.g., REST.
Level ##PROLVL## Supply the level number, e.g., 300.
Project ##PROJID## Supply the project name, e.g., RESTAPI.
Task ##TASKID## Supply the task number, e.g., 1.
Subtask ##STSKID## Supply the subtask number, e.g., 2.
Instance na Supply the MDCMS instance name, e.g., T84, or *DFT if using the default MDCMS instance (no suffix).
Location na Supply the location name, e.g., DEV.

SDK Creates MDCMS Object Request for API Source and OAPI Specification

When the Object Required checkbox in the MDRest4i SDK Edit Site dialogue is set, the SDK will create a object request in MDCMS for the generated API/Consumer Source, and another Object Request for the OAPI Specification.

MDRCPYOAPI - Command to Copy OAPI Specs

This command can be used manually from an IBM i command line, execute:

ADDLIBLE MDRST
MDRCPYOAPI  (then press F4 for prompt)
Prompted MDRCPYOAPI Command (illustrative)
                      MDRest4i Copy OAPI Specs (MDRCPYOAPI)                     

 Type choices, press Enter.                                                     

 Entity Name:  (Name) . . . . . . ENTITY       > apiname                        

 User Name: . . . . . . . . . . . USER         > STUART                         
 Copy From:    (*SDK, Name) . . . FROM         > *SDK                           

 Copy To:      (*SDK, Name) . . . TO           > 'APIS-100'                     

 Remove: Y/N  . . . . . . . . . . REMOVE       > Y                              
 Overwrite: Y/N . . . . . . . . . OVRWRT         N                              
 Install date:  . . . . . . . . . INSTDT       > '20.08.2025'                   
 RFP number:  . . . . . . . . . . RFPNBR       > 0120021                        
 App: . . . . . . . . . . . . . . APP          > APIS                           
 Lvl: . . . . . . . . . . . . . . LVL          > 100                            
 Project: . . . . . . . . . . . . PROJ                                          
 Task:  . . . . . . . . . . . . . TASK                                          
 Subtask: . . . . . . . . . . . . STASK                                         
                                                                        More... 
 F3=Exit   F4=Prompt   F5=Refresh   F12=Cancel   F13=How to use this display    
 F24=More keys                                                                  

See MDRCPYOAPI Parameter Reference for details

Promoting MDRDCFG Records

To use different program/library combinations when calling your API program in different runtime environments (DEV, PROD etc), a copy of MDRST/MDRDCFG should be placed in each API program library.

You can use a *DTAGRP type attribute in MDCMS to promote records from the MDRST library into your runtime API library, or between any two libraries that contain the MDRDCFG table.

!!! info "SDK Creates MDCMS Object Request for MDRDCFG record.

When the **MDRSTCFG Attr** field in the [MDRest4i SDK Edit Site dialogue](https://wiki.midrangedynamics.com/manuals/MDRest4i/manual/SiteAdmin/#edit-site) is set, the SDK will create an additional object request in MDCMS for the MDRDCFG record.

Add MDCMS Attribute for MDRDCFG DTAGRP Promotion

MDRDCFG contains the path to program map used by MDRest4i to know which prorgam to call. See tye Provider Overview for full details on this configuration mechanism.

In MDCMS, add an Attribute:

MDCMS Attribute example for MDRDCFG Record Promotion
MDCCMEM                          T86 Dev/Test                          1.09.25
SCRN2                         Attribute Record                        16:07:03

Application/Level . .  APIS   100                          Commands........: N
Object Type . . . . .  *DTAGRP     System or MDCMS Type    Scripts.........: N
Object Attribute  . .  OAPICFG                             Linked Checkouts: Y
Description . . . . .  MDRSTCFG record for API                                

Object Library  . . .  MDRTST14                                               

Archive Generations .  20                                                     
Retain Data Set . . .  Y           Y/N                                        
Allow *NONE . . . . .  Y           Y/N                                        
Require Approval  . .  N           N=Use Level Def, T=Template, Y=Yes         
Dft Compile Sequence   16                                                     
Acceptance Group Type                                                         
Ignore Dependencies .  N           Y/N                                        

Copy from Library . .                                                         

Enter=Confirm   F2=Full Name               F8=Data Group Files                
Parameter Description
Application As per your current setup
Example: APIS
Level As per your current setup
Example: 100
Object Type *DTAGRP
Object Attribute Any appropriate name
Note: This attribute is entered in the MDRSTCFG Attr field of the SDK Console Setup for MDCMS Interface
Example: OAPICFG
Description Any suitable description
Example: MDRest4i MDRDCFG Record
Ignore Dependencies Y

Press F8 to Specify the Data Group File-Field mapping.

Press F6 to Add File to Data Group

MDCMS Attribute Data File Group for MDRDCFG Record Promotion
MDCATDG                          T86 Dev/Test                          2.09.25 
SCRN2                       Add File to Data Group                    16:42:46 

Appl: APIS   Lvl: 100 Attribute: OAPICFG   Library: MDRTST14                  

File Name  . . . . MDRDCFG                                                     

Field 1  . . . . . MDRRSC      Starting Pos . .        Length . .              
  Fixed Value  . .                                                             
Field 2  . . . . .             Starting Pos . .        Length . .              
  Fixed Value  . .                                                             
Field 3  . . . . .             Starting Pos . .        Length . .              
  Fixed Value  . .                                                             

Record Option  . . *UPDADD     *ADDNEW  = add any new records for key to file  
                               *REPLACE = replace all records for key          
                               *UPDADD  = update matching and add new records  

Records Mandatory  N           Y = Records to migrate must exist for key       
                               N = Records for key are optional                

Enter=Confirm   F4=Browse   F12=Previous                                       
Parameter Description
File Name Always: MDRDCFG
Field 1 As per your current setup
Example: 100
Record Option *UPDADD
Records Mandatory N

SDK Console Setup for MDCMS Interface

  1. In the SDK Console UI, select Console Admin.
  2. Click Edit Site.
  3. In MDCMS Values, select Object Required.
  4. In MDCMS Base, add the host name of the MDCMS REST API server
  5. In MDCMS API Token add your token from the MDSEC Token system.
  6. In OAPI Attr field add the MDCMS Attribute you created for OAPI promotions.
  7. In MDRSTCFG Attr field add the MDCMS Attribute you created for MDRDCFG promotions.

MDCMS Promotion Steps

Simple Step-by-Step

  1. Create the API in the SDK Web UI.
  2. Save the OAPI document/specification in the SDK.
  3. An optional (1) step: To produce API Business documentation, select Publish from the Installation Details tab in MDRest4i Documenter.
  4. From the Generate tab of the SDK Web UI, select Submit Object Request.
  5. Specify options and submit. An object request will be created for the API/Consumer source and the OAPI specification.
  6. Promote as necessary and review the promoted OAPI specification in MDRest4i Documenter.
  1. ⚠ If the OAPI is published to the SDK Documnetr/Developer Portal, the MDRCPYOAPI.OVRWRT parameter should be set to "Y", when running the RFP installation or in the Attribute command setup. This will avoid losing any changes made to the business documentation.

MDCMS Object Request Interface

Select the path and method from the OAPI Spec

MDCMS Object Request Interface Path Select

Select the required values and submit

MDCMS Object Request Interface

Parameter Description

Input Description
Application The ID of the target application for the object to be selected from the dropdown list
Level A level number of the selected application that allows check-outs to be selected from the dropdown list
Object Type The System or MDCMS Object Type code for the Object
Attribute The MDCMS Attribute code that identifies the behaviour and target locations for the requested object
Object Name The name of the object to be requested
Project Specifies the Project to assign to the Request.
The project, if entered, must already exist and be in an open status.
If the project is not yet authorized, then the user must have MDSEC authority to authorize the Project and then MDCMS will do so automatically.
Task Specifies an existing, active Task number. Omit or set to 0 if the request would be assigned directly to the Project.
Subtask Specifies an existing, active Subtask number. Omit or set to 0 if the request should be assigned directly to the Project or Task
Assign Request to RFP If a level exists to migrate after this target level,
this parameter specifies if the generated object requests should be assigned to an RFP.
This parameter will only be applied to the RFP if it is created during the processing of this command.
Existing RFP number Specifies the RFP to assign to the Request.
Description of New RFP Description of New RFP

MDCMS, the MidRange Dynamic Change Management System can be integrated with MDRest4i-SDK-Console.

Swagger Extension x-mdcms

{
  "x-mdcms": {
    "object": {
      "vref": "*MDR",
      "user": "STUART",
      "appl": "APIS",
      "lvl": "100",
      "objt": "*PGM",
      "attr": "SQLRPGLE",
      "objn": "PULSEAPI",
      "folb": "mdrstt14",
      "fsfl": "QTSTSRC",
      "proj": "APIDEV",
      "task": "0",
      "stsk": "0",
      "arfp": "*AUTO",
      "rfp": "",
      "rfpd": "sams AI test",
      "fslb": "MDRTST14",
      "response": {
        "rtn": {
          "sev": "10",
          "msg": "Request created for PULSEAPI into RFP 120036"
        }
      }
    },
    "OAPI": {
      "appl": "APIS",
      "lvl": "100",
      "objt": "*DUMMY",
      "attr": "OAPISDK",
      "objn": "TestAPI",
      "task": "0",
      "stsk": "0",
      "user": "STUART",
      "proj": "APIDEV",
      "arfp": "*YES",
      "rfp": "120036",
      "rfpd": "",
      "response": {
        "rtn": {
          "sev": "10",
          "msg": "Request created for TestAPI into RFP 120036"
        }
      }
    },
    "MDRSTCFG": {
      "appl": "APIS",
      "lvl": "100",
      "objt": "*DTAGRP",
      "attr": "MDRSTCFG",
      "objn": "test-api",
      "task": "0",
      "stsk": "0",
      "user": "STUART",
      "proj": "APIDEV",
      "arfp": "*YES",
      "rfp": "120036",
      "rfpd": "",
      "response": {
        "rtn": {
          "sev": "10",
          "msg": "Request created for TestAPI into RFP 120036"
        }
      }
    }
  }
}

Importing Promoted Specifications to SDK

An MDCMS Level can be mapped to an MDRest4i Documenter Environment. The link is logical by name/coded reference designed by the user. In this way an OAPI specification stored in an MDRDPAGE record, can be mapped to a specific SCM APPLICATION/LEVEL(environment).

Once the user creates the OAPI spec and generates the RPG code in the SDK UI, they can submit an object request to MDCMS. The interface adds an object request for both the generated RPG source code and the OpenAPI specification.

From then on, MDCMS controls promotion of both artefact via the RFP.

  • The first promotion can remove the OAPI specification from the SDK user’s OAPI records, and moves it to the SDK Documenter Envirnment in MDRDPAGE on the same IBM i server. Each MDRest4i Documenter environment has its own MDRDPAGE record for saving OAPI specs and the generated HTML documentation.

  • When the OAPI spec and source code are promoted to the next MDCMS level by an RFP, the OAPI spec is removed from the previous level and added to the next MDCMS level, which has an MDRest4i Documenter Environment associated with it (via the MDCMS Attribute).

  • To checkout/request object for an existing OAPI specification not in an SDK user’s development folder (i.e., it resides in another Documenter Environment), the user can use Import from Developer Portal in the MDRest4i SDK. The cycle can then begin again.