This section handles the results configuration.

GET /results/config

GET /results/config/{result}

This method returns the list of results.

Request attribute:

    • result: Id of the result from which we want to obtain the information. If not indicated, all are shown.

Request parameters:

    • company [mandatory]: The company name or id.
    • session [mandatory]: The Id of the active session.
    • type: result type to filter by (0 good, 1 rework, 2 scrap, 255 all). The default values is 255.
    • showfields: indicates if the associated fields and their default values are shown (0 not shown, 1 if shown). The dafault value is 0.

Response:

    • status: Returns "0" on success, and an error code in any other case.
    • data: Returns the list of results and its properties.
    • message: "Success" or a descriptive information of the error in any other case.

Example:

Content-Type: application/json

Request: /results/config?company=demo01&session=LebEWTNf8GEhxfQeeGbBmVUlxmUIDLVdEoeVYrnWNzkdRXKxmgCNc92wnSjA

Reponse (success):

{

 "status": "0",

 "data": [

   {

     "id": "8561",

     "desc_de": "8561 1.4L",

     "desc_en": "8561 1.4L",

     "desc_es": "8561 1.4L",

     "desc_it": "8561 1.4L",

     "desc_pt": "8561 1.4L",

     "desc_sk": "8561 1.4L",

     "desc_zh": "8561 1.4L",

     "type": "0",

     "equiv": "1",

     "weight": "1",

     "url": "\\Servervlc01\SCalidad\Instruc\Instr. Inspeccion\8561\8561ii040-r07.doc = Inst. Inspección",

     "group": "0",

     "y0": "0",

     "g0": "0",

     "y1": "0",

     "g1": "0",

     "y2": "0",

     "g2": "0",

     "y3": "0",

     "g3": "0",

     "y4": "0",

     "g4": "0",

     "y5": "0",

     "g5": "0",

     "y6": "0",

     "g6": "0",

     "y7": "0",

     "g7": "0",

     "in_percentage": "0",

     "ignore_integration": "0",

     "replacement": "30",

     "expiration": "90",

     "minimum_stock": "300",

     "recurring": "0"

   },

   ...

 ],

 "message": "Success"

}


POST /results/config

This method creates a new result. The user must have the administrator role.

Request parameters (for additional information please review the result configuration):

    • company [mandatory]: the company name or id.
    • session [mandatory]: the Id of the active session.
    • id [mandatory]: the id of the result.
    • desc_de: description of the result (in german).
    • desc_en: description of the result (in english).
    • desc_es: description of the result (in spanish).
    • desc_it: description of the result (in italian).
    • desc_pt: description of the result (in portuguese).
    • desc_sk: description of the result (in slovak).
    • desc_zh: description of the result (in chinese).
    • type: production, rework or scrap.
    • equiv: every production counting is equivalent to how many pieces.
    • weight: weight of each piece (equiv.).
    • url: document or application that will be opened when the user clicks on the folder icon that appears after having clicked on the result, on the results window. Please see how to configure URLs.
    • group: if this result will be used to group results.
    • y0: yellow objective for availability.
    • g0: green objective for availability.
    • y1: yellow objective for speed.
    • g1: green objective for speed.
    • y2: yellow objective for quality.
    • g2: green objective for quality
    • y3: yellow objective for productive availability.
    • g3: green objective for productive availability.
    • y4: yellow objective for the quantity of MTBF.
    • g4: green objective for the quantity of MTBF.
    • y5: yellow objective for the MTBF.
    • g5: green objective for the MTBF.
    • y6: yellow objective for the MTTR.
    • g6: green objective for the MTTR.
    • y7: yellow objective for the OCE.
    • g7: green objective for the OCE.
    • inpct: if production is measured in %. Useful for results with a large cycle time (days or months) and to allow the working user to provide periodical advance of his work.
    • interign: marks the result as to be ignored when transferring from and to information to another system, like ERPs. Please see integration with other systems.
    • replacement: time it takes for the material to arrive since the order is placed (in days).
    • expiration: time in which a material expires since it is manufactured (in days).
    • minstock: minimum stock below which a new order must be placed.
    • recurring: indicates if this result will be recurring. Task or work orders which are marked as recurring can only generate recurring results.
    • replace: indicates if the result with the same id is going to be replaced with the new one. Defaul value is zero (no replacement).

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

This method creates a new result using json encoded B2MML data. The user must have the administrator role.

Request parameters (for additional information please review the result configuration):

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

Response:

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

Example:

{

"SyncProductDefinition": {

   "ApplicationArea": {

     "Sender": {

       "ComponentID": "ERP",

       "ConfirmationCode": "Always"

     },

     "CreationDateTime": "2017-02-10T07:30:03"

   },

   "DataArea": {

     "Sync": {

       "ActionCriteria": {

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

       }

     },

     "ProductDefinition": [

       {

         "ID": "PROD001",

         "Description": "Product Description",

         "Location": {

           "EquipmentID": "COMPANY",

           "EquipmentElementLevel": "Enterprise"

         },

         "ProductSegment": {

           "EquipmentSpecification": {

             "EquipmentID": "PROC001",

             "EquipmentSpecificationProperty": [

               {

                 "ID": "Equivalence",

                 "Quantity": {

                   "QuantityString": "1",

                   "DataType": "FLOAT",

                   "UnitOfMeasure": "UN"

                 }

               },

               {

                 "ID": "CycleT",

                 "Quantity": {

                   "QuantityString": "10",

                   "DataType": "FLOAT",

                   "UnitOfMeasure": "SEC"

                 }

               },

               {

                 "ID": "CycleQ",

                 "Quantity": {

                   "QuantityString": "1",

                   "DataType": "FLOAT",

                   "UnitOfMeasure": "UN"

                 }

               }

             ]

           }

         },

         "Any": {

           "ProductType": "0",

           "Equivalence": {

             "QuantityString": "1",

             "DataType": "FLOAT",

             "UnitOfMeasure": "UN"

           },

           "Weight": {

             "QuantityString": "1",

             "DataType": "FLOAT",

             "UnitOfMeasure": "KG"

           },

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

           "Fields": {

             "Field": {

               "ID": "FIELD",

               "Description": "Field_Description",

               "DataType": "STRING",

               "Mandatory": "Ifempty",

               "Context": "Input",

               "StandardClass": "Lot",

               "MaxLength": "20",

               "Calculated": "0",

               "Locked": "0",

               "Inherits": "1",

               "Stock": "1"

             }

           }

         }

       },

       {

         "ID": "PROD001.S1",

         "Description": "Scrap_Description",

         "Location": {

           "EquipmentID": "COMPANY",

           "EquipmentElementLevel": "Enterprise"

         },

         "ProductSegment": {

           "EquipmentSpecification": {

             "EquipmentID": "PROC001",

             "EquipmentSpecificationProperty": [

               {

                 "ID": "Equivalence",

                 "Quantity": {

                   "QuantityString": "1",

                   "DataType": "FLOAT",

                   "UnitOfMeasure": "UN"

                 }

               },

               {

                 "ID": "CycleT",

                 "Quantity": {

                   "QuantityString": "10",

                   "DataType": "FLOAT",

                   "UnitOfMeasure": "SEC"

                 }

               },

               {

                 "ID": "CycleQ",

                 "Quantity": {

                   "QuantityString": "1",

                   "DataType": "FLOAT",

                   "UnitOfMeasure": "UN"

                 }

               }

             ]

           },

           "MaterialSpecification": {

             "MaterialDefinitionID": "PROD001",

             "MaterialUse": "Consumed",

             "Quantity": {

               "QuantityString": "1",

               "DataType": "FLOAT",

               "UnitOfMeasure": "UN"

             }

           }

         },

         "Any": {

           "ProductType": "0",

           "Equivalence": {

             "QuantityString": "1",

             "DataType": "FLOAT",

             "UnitOfMeasure": "UN"

           },

           "Weight": {

             "QuantityString": "1",

             "DataType": "FLOAT",

             "UnitOfMeasure": "KG"

           },

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

           "Fields": {

             "Field": {

               "ID": "FIELD",

               "Description": "Field_Description",

               "DataType": "STRING",

               "Mandatory": "Ifempty",

               "Context": "Input",

               "StandardClass": "Lot",

               "MaxLength": "20",

               "Calculated": "0",

               "Locked": "0",

               "Inherits": "1",

               "Stock": "1"

             }

           }

         }

       }

     ]

   }

 }

}

Notes:

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

Any: Refers to result properties not found in the standard:

    • ProductType: production, rework or scrap.
    • Equivalence: every production counting is equivalent to how many pieces.
    • Weight: weight of each piece (equiv.).
    • Fields: refers to the list of custom properties added by the user:
      • ID, Description, DataType, Mandatory, Context, StandardClass, MaxLength, Calculated, Locked, Inherits and Stock are described in fields configuration section.

Response exmaple:

{

"status":"0",

"data":"{

\"ConfirmBOD\":{

\"ApplicationArea\":{

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

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

},

\"DataArea\":{

\"Confirm\":{

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

},

\"BOD\":[

{\"Description\":\"Accepted PROD001\",\"Note\":\"Product PROD001 updated successfully\"},

{\"Description\":\"Accepted PROD001.S1\",\"Note\":\"Product PROD001.S1 updated successfully\"}

]

}

}

}",

"message":"Success"

}


DELETE /results/config/{id}

This method deletes a result. The user must have the administrator role.

Request attribute:

    • id [mandatory]: the Id of the result to delete.

Request parameters:

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

Response:

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

GET /results/config/{result}/relatedresults

This method returns the relationship between the result and its rework or scrap.

Request attribute:

    • result [mandatory]: Id of the result whose related results we want to get.

Request parameters:

    • company [mandatory]: the company name or id.
    • session [mandatory]: the Id of the active session.
    • result [mandatory]: the Id of the active result.
    • type [mandatory]: the index of product type.
      • type = 0: Production
      • type = 1: Scrap
      • type = 2: Rework

Response:

    • status: returns "0" on success, and an error code in any other case.
    • data: returns the list of results.
    • message: "success" or a descriptive information of the error in any other case.

Request:

{"type":"get",

"url":"results/config/res0001/relatedresults",

"data":"company=testco&session=neQXoKWYLALJ1yVjr5d2ANOhZrwp52p5qeyM7WdzAi96rJ5QKmGHsIyF5tzV&type=1"}


Reponse (success):

{

"status":"0",

"data":[


{"Id_prod":"res001.S1","Desc":"Setup"},

{"Id_prod":"res001.S2","Desc":"Operator"},

{"Id_prod":"res001.S3","Desc":"Raw material"}

],

"message":"Success"

}


Reponse (error):

{"status":"1005",

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

"message":"No data available"}

POST /results/config/{result}/relatedresults

This method allows you to create the relationship between two results. If the relationship already exists and is of the same type, it updates the data. If it does not exist or is of a different type, it adds it.

Request attribute:

    • result [mandatory]: Id of the result to which we want to add a related result.

Request parameters:

    • company [mandatory]: the company name or id.
    • session [mandatory]: the Id of the active session.
    • relatedresult [mandatory]: Result we want to relate.
    • relationtype [mandatory]: Relationship type.
      • 1: Input. Each time a result occurs, an amount of the related result will be consumed.
      • 2: Output. Each time a result is produced, an amount of the related result will be produced.
    • quantity: Amount of the related result to be consumed or produced each time a result is produced. Default is 1.
    • confirm: If set to 1, it asks for confirmation when the related result is to be consumed or produced, and allows the related result to be changed.
    • produced: If it is set to 1, it indicates that the result has been produced internally and has not been acquired.

Response:

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

Request:

{"type":"post",

"url":"results/config/res0001/relatedresults",

"data":"company=testco&session=neQXoKWYLALJ1yVjr5d2ANOhZrwp52p5qeyM7WdzAi96rJ5QKmGHsIyF5tzV&relatedresult=res0002&relationtype=1&quantity=20"}


Reponse (success):

{

"status":"0",

"data":"true",

"message":"Success"

}


Reponse (error):

{"status":1074,

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

"message":"Result not found"}

GET /results/config/{result}/fields

The method returns the field definition related with a result.

Request attribute:

    • result [mandatory]: Id of the result whose fields we want to get.

Request parameters:

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

Response:

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

Request:

{"type":"get",

"url":"results/config/res0001/fields",

"data":"company=testco&session=neQXoKWYLALJ1yVjr5d2ANOhZrwp52p5qeyM7WdzAi96rJ5QKmGHsIyF5tzV"}


Reponse (success):

{

"status":"0",

"data":[

{

"id":"20200520113706AACCENTRAL",

"parentid":"res0001",

"order":"0",

"name":"COLOR",

"description":"NumerodeColores",

"default":"4",

"datatype":"4",

"mandatory":"2",

"fielddomainid":"",

"context":"0",

"calculation":"",

"standardclass":"0",

"maxlength":"0",

"calculated":"0",

"locked":"0",

"inherits":"0",

"stock":"0",

"recurring":"0"

}

],

"message":"Success"

}


Reponse (error):

{"status":"1005",

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

"message":"No data available"}