This section handles scheduled orders configuration.

GET /schedule

Request parameters:

    • company [mandatory]: The company name or id.
    • session [mandatory]: The Id of the active session.
    • process: process to which the order is assigned.
    • datefrom: minimum date on which the order is scheduled.
    • dateto: maximum date on which the order is scheduled.
    • pn [deprecated]: work order code. Use the order parameter instead
    • order: work order code.
    • status: indicates the status of the orders that you want to obtain. The possible values are:
      • 0: Prescheduled
      • 1: Scheduled
      • 2: Working
      • 3: Paused
      • 4: Prefinished
      • 5: Finished
      • 6: Canceled
      • 7: All
      • 8: Pending (that is, prescheduled, schedueld, working or paused)
    • If omitted, the default value is 8 (pending).
    • filter: is a text string that is used to locate orders that contain it in any of these fields: order code, result code, result description, comment and reference.

Response:

    • status: returns "0" on success, and an error code in any other case.
    • data: returns list of work orders that match the indicated criteria on success or the link to the request help on error.
    • message: "Success" or a descriptive information of the error in any other case.

Example:

Request:

{"type":"get",

"url":"schedule",

"data":"company=testco&session=kOORid1fkPhuSFAmakcSHEJ5Vzp3egJ87zfuCDDR5J4A4uLQBfMdwFankFfb&order=12345"}

Reponse (success):

{

"status":0,

"data":[

{

"Id":"20180515130923TMACENTRAL",

"MachDate":"P00120180515162312",

"OrderId":"12345",

"id_prod":"RES0001",

"QT":"82,5",

"Target":"82,5",

"SetupTime":"0",

"CycleT":"15",

"CycleQ":"0,087766",

"TeardownTime":"0",

"DueDate":"20180515220000",

"Status":"5",

"Started":"20180523154422",

"Ended":"20180523195228",

"Comment":"Resultado de prueba 1",

"Ref":"<Sch:12345><Req:12345><Seg:10>",

"Id_Author":"CENTRAL",

"Created":"20180515130925",

"Id_Mod":"",

"Modified":"",

"Link":"",

"URL":"",

"Id_TU":"0",

"Id_Sche":"",

"Work":"",

"WBS":"",

"Esti":"0",

"DisableNotif":"0"

}

],

"message":"Success"

}

Reponse (error):

{"status":1005,

"data":"<a href='http:\/\/127.0.0.1:8080\/edinnM2\/help\/en\/API_Schedule_Oper.html'>for additional information follow this link<\/a>",

"message":"No data available"}

POST /schedule (ISA-95 compliant, for more information please read the B2MML document)

This method creates a scheduled order using json encoded B2MML data. The user must have the scheduler role.

Request parameters:

    • company [mandatory]: The company name or id.
    • session [mandatory]: The Id of the active session.
    • data [mandatory]: the json encoded B2MML data defining the scheduled order.

Response:

    • status: Returns "0" on success, and an error code in any other case.
    • data: the json encoded B2MML response.
    • message: "Success" or a descriptive information of the error in any other case.

Example (the work order data is sent encoded to be used as the query part of a URL):

Request:

{"type":"post",

"url":"schedule",

"data":"company=testco&session=1FrqhchVXQoAgpxUbdKHWQkILZjMMAV0cesiSMmaRjwFvaWLwrpLyxJ6O9Zo&data=%7B%22SyncProductionSchedule%22%3A%7B%22ApplicationArea%22%3A%7B%22Sender%22%3A%7B%22ComponentID%22%3A%22ERP%22%2C%22ConfirmationCode%22%3A%22Always%22%7D%2C%22CreationDateTime%22%3A%222020-09-23T10%3A41%3A00%22%7D%2C%22DataArea%22%3A%7B%22Sync%22%3A%7B%22ActionCriteria%22%3A%7B%22ActionExpression%22%3A%7B%22%40actionCode%22%3A%22Add%22%7D%7D%7D%2C%22ProductionSchedule%22%3A%7B%22ID%22%3A%2220200901%22%2C%22ProductionRequest%22%3A%7B%22ID%22%3A%222020092304%22%2C%22StartTime%22%3A%222020-09-23T16%3A00%3A00%22%2C%22EndTime%22%3A%222020-09-23T18%3A00%3A00%22%2C%22SegmentRequirement%22%3A%7B%22ID%22%3A%2210%22%2C%22Description%22%3A%22BOLSAS%20DE%2024x28%22%2C%22EarliestStartTime%22%3A%222020-09-23T16%3A00%3A00%22%2C%22LatestEndTime%22%3A%222020-09-23T18%3A00%3A00%22%2C%22Duration%22%3A%22P0Y0M0DT2H0M0S%22%2C%22PersonnelRequirement%22%3A%7B%22PersonnelClassID%22%3A%7B%7D%2C%22PersonID%22%3A%7B%7D%2C%22Location%22%3A%7B%22EquipmentID%22%3A%22TESTCO%22%2C%22EquipmentElementLevel%22%3A%22Enterprise%22%7D%2C%22Quantity%22%3A%7B%22QuantityString%22%3A%221%22%2C%22DataType%22%3A%22double%22%2C%22UnitOfMeasure%22%3A%22UN%22%7D%7D%2C%22EquipmentRequirement%22%3A%7B%22EquipmentClassID%22%3A%7B%7D%2C%22EquipmentID%22%3A%227102%22%2C%22Location%22%3A%7B%22EquipmentID%22%3A%22TESTCO%22%2C%22EquipmentElementLevel%22%3A%22Enterprise%22%7D%2C%22Quantity%22%3A%7B%22QuantityString%22%3A%221%22%2C%22DataType%22%3A%22double%22%2C%22UnitOfMeasure%22%3A%22UN%22%7D%2C%22EquipmentRequirementProperty%22%3A%7B%22ID%22%3A%22ID_TU%22%2C%22Value%22%3A%7B%22ValueString%22%3A%226104%22%2C%22DataType%22%3A%7B%7D%2C%22UnitOfMeasure%22%3A%7B%7D%7D%7D%7D%2C%22MaterialRequirement%22%3A%5B%7B%22MaterialClassID%22%3A%7B%7D%2C%22MaterialDefinitionID%22%3A%22BB0932428102%5C%2F4351%22%2C%22MaterialLotID%22%3A%7B%7D%2C%22MaterialUse%22%3A%22Produced%22%2C%22Quantity%22%3A%7B%22QuantityString%22%3A%221000%22%2C%22DataType%22%3A%22double%22%2C%22UnitOfMeasure%22%3A%22MI%22%7D%2C%22MaterialRequirementProperty%22%3A%7B%22ID%22%3A%22Equiv%22%2C%22Description%22%3A%22Equivalence%22%2C%22Quantity%22%3A%7B%22QuantityString%22%3A%221%22%2C%22DataType%22%3A%22double%22%2C%22UnitOfMeasure%22%3A%22KG%22%7D%7D%7D%2C%7B%22MaterialClassID%22%3A%7B%7D%2C%22MaterialDefinitionID%22%3A%22BO24035044%22%2C%22MaterialLotID%22%3A%7B%7D%2C%22MaterialUse%22%3A%22Consumed%22%2C%22Quantity%22%3A%7B%22QuantityString%22%3A%22238%22%2C%22DataType%22%3A%22double%22%2C%22UnitOfMeasure%22%3A%22KG%22%7D%2C%22MaterialRequirementProperty%22%3A%7B%22ID%22%3A%22Equiv%22%2C%22Description%22%3A%22Equivalence%22%2C%22Quantity%22%3A%7B%22QuantityString%22%3A%221%22%2C%22DataType%22%3A%22double%22%2C%22UnitOfMeasure%22%3A%22KG%22%7D%7D%7D%5D%7D%7D%7D%7D%7D%7D"}


Reponse (success):

{"status":"0",

"data":"{\"ConfirmBOD\":{\"ApplicationArea\":{\"Sender\":{\"LogicalID\":\"20200924090208ACJCENTRAL\",\"ComponentID\":\"EDINN\",\"ConfirmationCode\":\"Always\"},\"CreationDateTime\":\"2020-09-24T09:02:08\"},\"DataArea\":{\"Confirm\":{\"ResponseCriteria\":{\"ResponseExpression\":{\"@actionCode\":\"Accepted\"}}},\"BOD\":{\"Description\":\"Accepted 2020092304\",\"Note\":\"segment 10 of the order 2020092304 inserted successfully.\"}}}}",

"message":"Success"}


Reponse (error):

{"status":"0",

"data":"{\"ConfirmBOD\":{\"ApplicationArea\":{\"Sender\":{\"LogicalID\":\"20200924090448ZOZCENTRAL\",\"ComponentID\":\"EDINN\",\"ConfirmationCode\":\"Always\"},\"CreationDateTime\":\"2020-09-24T09:04:48\"},\"DataArea\":{\"Confirm\":{\"ResponseCriteria\":{\"ResponseExpression\":{\"@actionCode\":\"Rejected\"}}},\"BOD\":{\"Description\":\"Rejected 2020092304\",\"Note\":\"Must provide a equipment requirement (Equipment 8102 does not exist in database) (Operation cancelled by an error)\"}}}}",

"message":"Success"}

Example of uncoded work order data.

{

 "SyncProductionSchedule": {

   "ApplicationArea": {

     "Sender": {

       "ComponentID": "ERP",

       "ConfirmationCode": "ALWAYS"

     },

     "CreationDateTime": "2019-10-30T15:06:51.065224+00:00"

   },

   "DataArea": {

     "Sync": {

       "ActionCriteria": {

         "ActionExpression": { "@actionCode": "Add" }

       }

     },

     "ProductionSchedule": {

       "ID": "PS000001",

       "ProductionRequest": {

         "ID": "PR000001",

         "Description": "Request description",

         "Location": {

           "EquipmentID": "P10",

           "EquipmentElementLevel": "Site",

           "Location": {

             "EquipmentID": "L10",

             "EquipmentElementLevel": "ProductionLine"

           }

         },

         "StartTime": "2019-10-30T15:06:51.0662173+00:00",

         "EndTime": "2019-11-06T15:06:51.0662173+00:00",

         "RequestState": "Planned",

         "SegmentRequirement": {

           "ID": "SR10",

           "Description": "Segment description",

           "Location": {

             "EquipmentID": "P10",

             "EquipmentElementLevel": "Site",

             "Location": {

               "EquipmentID": "L10",

               "EquipmentElementLevel": "ProductionLine"

             }

           },

           "DocumentURL": "\\\\DOCS_FOLDER\\DOC.INF",

           "EarliestStartTime": "2019-10-30T15:06:51.0662173+00:00",

           "LatestEndTime": "2019-11-06T15:06:51.0662173+00:00",

           "Duration": "P0Y0M0DT1H36M0S",

           "ProductionParameter": {

             "ID": "OperationType",

             "Value": {

               "ValueString": "OP01",

               "DataType": "string"

             }

           },

           "ProductionParameter": {

             "ID": "WBS",

             "Value": {

               "ValueString": "1234",

               "DataType": "string"

             }

           },

           "PersonnelRequirement": [

             {

               "PersonnelClassID": "LB01",

               "PersonID": "WO001",

               "Quantity": {

                 "QuantityString": "30.000",

                 "DataType": "double",

                 "UnitOfMeasure": "HUR"

               },

               "Location": {

                 "EquipmentID": "CONAME",

                 "EquipmentElementLevel": "Enterprise"

               }

             },

             {

               "PersonnelClassID": "LB01",

               "PersonID": "WO001",

               "Quantity": {

                 "QuantityString": "1",

                 "DataType": "double",

                 "UnitOfMeasure": "UN"

               },

               "Location": {

                 "EquipmentID": "CONAME",

                 "EquipmentElementLevel": "Enterprise"

               }

             }

           ],

           "EquipmentRequirement": {

             "EquipmentClassID": "EC01",

             "EquipmentID": "EQ01",

             "Quantity": {

               "QuantityString": "1",

               "DataType": "double",

               "UnitOfMeasure": "UNIT"

             },

             "Location": {

               "EquipmentID": "CONAME",

               "EquipmentElementLevel": "Enterprise",

               "Location": {

                 "EquipmentID": "L10",

                 "EquipmentElementLevel": "PoductionLine"

               }

             }

           },

           "MaterialRequirement": [

             {

               "MaterialClassID": "MC01",

               "MaterialDefinitionID": "MT0001",

               "MaterialLotID": "LOT0001",

               "MaterialSubLotID": "SLOT01",

               "Location": {

                 "EquipmentID": "SZ01",

                 "EquipmentElementLevel": "StorageZone",

                 "Location": {

                   "EquipmentID": "SU01",

                   "EquipmentElementLevel": "StorageUnit"

                 }

               },

               "MaterialUse": "Produced",

               "Quantity": {

                 "QuantityString": "100",

                 "DataType": "double",

                 "UnitOfMeasure": "UNIT"

               },

               "MaterialRequirementProperty": {

                 "ID": "PROP01",

                 "Value": {

                   "ValueString": "VAL0001",

                   "DataType": "string"

                 }

               }

             },

             {

               "MaterialClassID": "MC02",

               "MaterialDefinitionID": "MT0002",

               "MaterialLotID": "LOT0002",

               "MaterialSubLotID": "SLOT02",

               "Location": {

                 "EquipmentID": "SZ01",

                 "EquipmentElementLevel": "StorageZone"

               },

               "MaterialUse": "Consumed",

               "Quantity": {

                 "QuantityString": "100",

                 "DataType": "double",

                 "UnitOfMeasure": "UNIT"

               },

               "MaterialRequirementProperty": {

                 "ID": "PROP02",

                 "Value": {

                   "ValueString": "VAL0002",

                   "DataType": "string"

                 }

               },

               "Any": {

                 "Confirm": {

                   "ValueString": "1",

                   "DataType": "integer"

                 }

               }

             }

           ],

           "SegmentRequirement": [

             {

               "ID": "Setup",

               "Duration": "PT2H0M0S"

             },

             {

               "ID": "Processing",

               "Duration": "PT60H0M0S"

             }

           ]

         }

       }

     }

   }

 }

}

Notes:

B2MML tags not present in this document will be ignored by the system, althought could be considered for future versions.

RequestState: Refers to the status of the scheduled order. Allowed values are:

    • Preplanned: The order date and time and the allocation of resources are not final and should be planned or confirmed.
    • Planned: The order date and time and the allocation of resources are final.
    • Completed: The order has been completed in the ERP.

DocumentURL: Path to a document with information about the order.

Duration: If provided, the cycle time and the cycle quantity of the order will be calculated according to its value, otherwise, they will be inherited from the cycle time and the cycle quantity of the process.

Response example:

{

"status":"0",

"data":"{

\"ConfirmBOD\":{

\"ApplicationArea\":{

\"Sender\":{\"ComponentID\":\"EDINN\",\"ConfirmationCode\":\"Always\"},

\"CreationDateTime\":\"2019-11-12T11:38:16\"

},

\"DataArea\":{

\"Confirm\":{

\"ResponseCriteria\":{\"ResponseExpression\":{\"@actionCode\":\"Accepted\"}}

},

\"BOD\":{

\"Description\":\"Accepted PR000001\",\"Note\":\"segment SR10 of the order PR000001 inserted successfully.\"

}

}

}

}",

"message":"Success"

}

Response example of a working order tha could not be inserted:

{

"status":"0",

"data":"{

\"ConfirmBOD\":{

\"ApplicationArea\":{

\"Sender\":{\"ComponentID\":\"EDINN\",\"ConfirmationCode\":\"Always\"},

\"CreationDateTime\":\"2019-11-12T11:38:16\"

},

\"DataArea\":{

\"Confirm\":{

\"ResponseCriteria\":{\"ResponseExpression\":{\"@actionCode\":\"Rejected\"}}

},

\"BOD\":{

\"Description\":\"Rejected PR000001\",\"Note\":\"Must provide a equipment requirement (Equipment EQ01 does not exist in database) (Operation cancelled by an error)\"

}

}

}

}",

"message":"Success"

}

POST /schedule

This method creates a scheduled order. The user must have the scheduler permission.

Request parameters (for additional information please review the schedule edition):

    • company [mandatory]: the company name or id.
    • session [mandatory]: the Id of the active session.
    • area [mandatory]: area to which the order belongs.
    • process: process to which the order is assigned.
    • date [mandatory]: scheduled start date and time.
    • order [mandatory]: order code.
    • result [mandatory]: result to be produced.
    • target [mandatory]: target quantity of the order.
    • duedate [mandatory]: expected end date and time of the order.
    • duration: duration of the order.
    • comment: text that describes the order.

Reponse:

    • status: returns "0" on success, and an error code in any other case.
    • data: returns the link to the request help on error.
    • message: "Success" or a descriptive information of the error in any other case.

Example:

Request:

{"type":"post",

"url":"schedule",

"data":"company=7362919493&session=1FrqhchVXQoAgpxUbdKHWQkILZjMMAV0cesiSMmaRjwFvaWLwrpLyxJ6O9Zo&area=7100&process=7101&date=20201101000000&duedate=20201108000000&order=20201102&result=BA0932535201&target=100&comment=Bolsas25x35"}


Reponse (success):

{"status":0,

"data":null,

"message":"Success"}


Reponse (error):

{"status":"1000",

"data":"<a href='http:\/\/127.0.0.1:8080\/edinnM2\/help\/en\/API_Schedule_Config.html'>for additional information follow this link<\/a>",

"message":"Some parameters are missing"}

DELETE /schedule/{id}

This method deletes a scheduled order identified by its unique code in edinn. The user must have scheduler permission.

Request parameters:

    • company [mandatory]: the company name or id.
    • session [mandatory]: the Id of the active session.

Request attributes:

    • id [mantatory]: id of the working order.

Response:

    • status: returns "0" on success, and an error code in any other case.
    • data: returns the link to the request help on error.
    • message: "Success" or a descriptive information of the error in any other case.

Ejemplo:

Request:

{"type":"delete",

"url":"schedule/20201009110800AABCENTRAL",

"data":"company=7362919493&session=1FrqhchVXQoAgpxUbdKHWQkILZjMMAV0cesiSMmaRjwFvaWLwrpLyxJ6O9Zo"}


Reponse (success):

{"status":"0",

"data":null,

"message":"Success"}


Reponse (error):

{"status":1007,

"data":"<a href='http:\/\/127.0.0.1:8080\/edinnM2\/help\/en\/API_Schedule_Config.html'>for additional information follow this link<\/a>",

"message":"Session not stablished"}

DELETE /schedule

This method removes a scheduled orders identified by its process and code. The user must have the scheduler permission.

Request parameters:

    • company [mandatory]: the company name or id.
    • session [mandatory]: the Id of the active session.
    • process [mandatory]: the process where is the order.
    • order [mandatory]: the code of the order.

Reponse:

    • status: returns "0" on success, and an error code in any other case.
    • data: returns the link to the request help on error.
    • message: "Success" or a descriptive information of the error in any other case.

Example:

Request:

{"type":"delete",

"url":"schedule/20201009110800AABCENTRAL",

"data":"company=7362919493&session=1FrqhchVXQoAgpxUbdKHWQkILZjMMAV0cesiSMmaRjwFvaWLwrpLyxJ6O9Zo&process=TT00&order=20201009110800AAB"}


Reponse (success):

{"status":"0",

"data":null,

"message":"Success"}


Reponse (error):

{"status":1007,

"data":"<a href='http:\/\/127.0.0.1:8080\/edinnM2\/help\/en\/API_Schedule_Oper.html'>for additional information follow this link<\/a>",

"message":"Session not stablished"}

PATCH /schedule/{id}/reschedule

This method is used to change the planned start date, end date, quantity, and / or duration of a scheduled order. User must have rescheduler permission.

Request parameters:

    • company [mandatory]: the company name or id.
    • session [mandatory]: the Id of the active session.
    • date: scheduled start date and time.
    • target: target quantity of the order.
    • duedate: expected end date and time of the order.
    • duration: duration of the order.

Request attributes:

    • id [mantatory]: id of the working order.

Reponse:

    • status: devuelve "0" en caso de éxito y un código de error en cualquier otro caso.
    • data: devuelve el enlace a la ayuda de la solicitud en caso de error.
    • message: "Success" o una información descriptiva del error en cualquier otro caso.

Example:

Request:

{"type":"patch",

"url":"schedule/20211105171958AACINIT/reschedule",

"data":"company=7362919493&session=1FrqhchVXQoAgpxUbdKHWQkILZjMMAV0cesiSMmaRjwFvaWLwrpLyxJ6O9Zo&date=20201009113000&duedate=20201009163000&target=950&duration=3000"}


Reponse (success):

{"status":"0",

"data":null,

"message":"Success"}


Reponse (error):

{"status":1007,

"data":"<a href='http:\/\/127.0.0.1:8080\/edinnM2\/help\/en\/API_Schedule_Config.html'>for additional information follow this link<\/a>",

"message":"Session not stablished"}

PUT /schedule/{id}

This method replaces all the parameters of a scheduled order. The user must have the scheduler permission.

Request parameters (for additional information please review the schedule edition):

    • company [mandatory]: the company name or id.
    • session [mandatory]: the Id of the active session.
    • area [mandatory]: area to which the order belongs.
    • process: process to which the order is assigned.
    • date [mandatory]: scheduled start date and time.
    • order [mandatory]: order code.
    • result [mandatory]: result to be produced.
    • target [mandatory]: target quantity of the order.
    • duedate [mandatory]: expected end date and time of the order.
    • duration: duration of the order.
    • comment: text that describes the order.

Request attributes:

    • id [mantatory]: id of the working order.

Reponse:

    • status: returns "0" on success, and an error code in any other case.
    • data: returns the link to the request help on error.
    • message: "Success" or a descriptive information of the error in any other case.

Example:

Request:

{"type":"put",

"url":"schedule/20211027133604AABINIT",

"data":"company=7362919493&session=1FrqhchVXQoAgpxUbdKHWQkILZjMMAV0cesiSMmaRjwFvaWLwrpLyxJ6O9Zo&area=7100&process=7101&date=20201101000000&duedate=20201108000000&order=20201102&result=BA0932535201&target=100&comment=Bolsas25x35"}


Reponse (success):

{"status":0,

"data":null,

"message":"Success"}


Reponse (error):

{"status":"1000",

"data":"<a href='http:\/\/127.0.0.1:8080\/edinnM2\/help\/en\/API_Schedule_Config.html'>for additional information follow this link<\/a>",

"message":"Some parameters are missing"}