Operation
This section handles the processes operation.
GET /processes/{process}/activeresult
This method returns the active result.
Request attribute:
- Process [mandatory]: the id of the process
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 list of results.
- message: "success" or a descriptive information of the error in any other case.
Content-Type: application/json Request: /processes/A0L1/activeresult?session=rB9RmQypCzdbiJjomQktYH2Uh8Rdljtal0Cn1ga1qjtRMKWyNNP405lyBs2h&company=DEMO01 Reponse (success): { "status": "0", "data": [ { "Id_prod": "8563", "Desc": "8563 1.8L Lynx" } ] "message": "Success" } |
GET /processes/{process}/cpk
This method returns the cpk information of a process.
Request attribute:
- Process [mandatory]: the id of the process
Request parameters:
- company [mandatory]: the company name or id.
- session [mandatory]: the Id of the active session.
- datefrom [mandatory]: start date of the period.
Response:
- status: returns "0" on success, and an error code in any other case.
- data: returns the CPK of the selected process.
- message: "success" or a descriptive information of the error in any other case.
Example:
Request:
/processes/A0L1/cpk
{
"session": 01qgmfcZmZ4nqg2eNGpxY4JlpmhJuKw1H31p5rtD1a112SSK8S8odROFIKgn
"company": DEMO04
“Datefrom”: 20171001000000
}
Response:
{
"status": 0,
"Data":
{
"Cpk": "0"
}
"message": "Success"
}
GET /processes/{process}/cycleTime
This method returns the cycle time information of a process
Request attribute:
- Process [mandatory]: the id of the process
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 current cycle time information of the process.
- message: "Success" or a descriptive information of the error in any other case.
Example:
Request:
/processes/A0L1/cycleTime
{
"session": 01qgmfcZmZ4nqg2eNGpxY4JlpmhJuKw1H31p5rtD1a112SSK8S8odROFIKgn
"company": DEMO04
}
Response:
{
"status":0,
"data":
{
"Val": "3470",
"DateTime": "20200902134938",
"CycleOT": "0",
"CycleT": "11"
}
"message":"Success"
}
GET /processes/{process}/kpicalculated
This method returns the calculated KPI information of a process, given an algorithm, a set of one or more variables, and a description.
Request attribute:
- Process [mandatory]: the id of the process
Request parameters:
- company [mandatory]: The company name or id.
- session [mandatory]: The Id of the active session.
- datefrom [mandatory]: start date of the period.
- dateto [mandatory]: end date of the period.
- algorithm [mandatory]:mathematic function used to calculate the result. Variables must be enclosed with quotation marks, for example: "Width".
- variables [mandatory]:variables that will be requested in order to calculate the quantity. There are predefined variables in configuration.
- description [mandatory]: A description of the result to be obtained.
Response:
- status: Returns "0" on success, and an error code in any other case.
- data: Returns calculated KPI information of the process.
- message: "Success" or a descriptive information of the error in any other case.
Example:
Request:
/processes/A0L1/kpicalculated
{
"session": 01qgmfcZmZ4nqg2eNGpxY4JlpmhJuKw1H31p5rtD1a112SSK8S8odROFIKgn
"company": DEMO04
"datefrom":20170401000000
“dateto”: 20201010000000
"algorithm": "NumOpers"*"CycleT"
"variables": NumOpers,CycleT
"description": "Result"
}
Response:
{
"status": "0",
"data": [
{
""result"": "1"
}
],
"message": "Success"
}
GET /processes/{process}/monitor
This method returns the monitor information of a process
Request attribute:
- Process [mandatory]: the id of the process
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 monitor item value of the selected process, or null in the case that there is no data to return.
- message: "success" or a descriptive information of the error in any other case.
Example:
Request:
/processes/A0L1/monitor
{
"session": 01qgmfcZmZ4nqg2eNGpxY4JlpmhJuKw1H31p5rtD1a112SSK8S8odROFIKgn
"company": DEMO04
}
Response:
{
"status": 0,
"Data":
{
null
}
"message": "Success"
}
GET /processes/{process}/mtbf
This method returns the mtbf information of a process
Request attribute:
- Process [mandatory]: the id of the process
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 four MTBF fields of the selected process.
- message: "success" or a descriptive information of the error in any other case.
Example:
Request:
/processes/A0L1/mtbf
{
"session": 01qgmfcZmZ4nqg2eNGpxY4JlpmhJuKw1H31p5rtD1a112SSK8S8odROFIKgn
"company": DEMO04
}
Response:
{
"status": 0,
"Data":
{
{
"MTBF": "0",
"MTTR": "0",
"MTBFQ": "0",
"MTBFLastUpdate": "04/09/2020 10:59:48"
}
}
"message": "Success"
}
GET /processes/{process}/production
This method returns the amount of goods produced by a process between a start and end date, pertaining to classifications of: bad, good, theoretical, and total.
Request attribute:
- Process [mandatory]: the id of the process
Request parameters:
- company [mandatory]: the company name or id.
- session [mandatory]: the Id of the active session.
- datefrom [mandatory]: start date of the period.
- dateto [mandatory]: end date of the period.
Response:
- status: returns "0" on success, and an error code in any other case.
- data: returns the quantity of goods produced of a process.
- message: "success" or a descriptive information of the error in any other case.
Example:
Request:
/processes/A0L1/production
{
"session": 01qgmfcZmZ4nqg2eNGpxY4JlpmhJuKw1H31p5rtD1a112SSK8S8odROFIKgn
"company": DEMO04
“Datefrom”: 20201001000000
“Dateto”: 20201030000000
}
Response:
{
"status": 0,
"Data":
{
"Prod": "",
"ProdBad": "0",
"ProdTheor": "0",
"ProdGood": "0",
"ProdTotal": "0"
}
"message": "Success"
}
GET processes/{process}/productionKg
This method returns the bad, theoretical, good, and total weight of goods produced by a process between a start and end date.
Request attribute:
- Process [mandatory]: the id of the process
Request parameters:
- company [mandatory]: the company name or id.
- session [mandatory]: the Id of the active session.
- datefrom [mandatory]: start date of the period.
- dateto [mandatory]: end date of the period.
Response:
- status: returns "0" on success, and an error code in any other case.
- data: returns the produced Kgs of a process
- message: "success" or a descriptive information of the error in any other case.
Example:
Request:
/processes/A0L1/productionKg
{
"session": 01qgmfcZmZ4nqg2eNGpxY4JlpmhJuKw1H31p5rtD1a112SSK8S8odROFIKgn
"company": DEMO04
“Datefrom”: 20201001000000
“Dateto”: 20201030000000
}
Response:
{
"status": 0,
"Data":
{
"ProdBadKgs": "0",
"ProdTheorKgs": "0",
"ProdGoodKgs": "0",
"ProdTotalKgs": "0"
}
"message": "Success"
}
GET /processes/{process}/prodTheorN
This method returns the theoretical amount of goods produced by a process between a start and end date.
Request attribute:
- Process [mandatory]: the id of the process
Request parameters:
- company [mandatory]: the company name or id.
- session [mandatory]: the Id of the active session.
- datefrom [mandatory]: start date of the period.
- dateto [mandatory]: end date of the period.
Response:
- status: returns "0" on success, and an error code in any other case.
- data: returns the theoretical quantity produced of a process
- message: "success" or a descriptive information of the error in any other case.
Example:
Request:
/processes/A0L1/prodTheorN
{
"session": 01qgmfcZmZ4nqg2eNGpxY4JlpmhJuKw1H31p5rtD1a112SSK8S8odROFIKgn
"company": DEMO04
“Datefrom”: 20201001000000
“Dateto”: 20201030000000
}
Response:
{
"status": 0,
"Data":
{
"ProdTheorN": "0"
}
"message": "Success"
}
GET /processes/{process}/QActivity
This method returns the activity of the process taking into account the production of the variables indicated in QColumn1 and QColumn2, where the total activity time is the time resulting from all the states of the period multiplying the time of each one by the percentage of activity of the state.
Request attribute:
- Process [mandatory]: the id of the process
Request parameters:
- company [mandatory]: the company name or id.
- session [mandatory]: the Id of the active session.
- datefrom [mandatory]: start date of the period.
- dateto [mandatory]: end date of the period.
- QColumn1 [mandatory]: first quantity column to perform the calculation.
- QColumn2: second quantity column to perform the calculation.
- QFactor: time conversion ratio. If omitted, the activity will be displayed in units per hour.
Response:
- status: returns "0" on success, and an error code in any other case.
- data: returns the
- message: "success" or a descriptive information of the error in any other case.
Example:
Request:
/processes/A0L1/QActivity
{
"session": 01qgmfcZmZ4nqg2eNGpxY4JlpmhJuKw1H31p5rtD1a112SSK8S8odROFIKgn
"company": DEMO04
“Datefrom”: 20201001000000
“Dateto”: 2020103000000
"QColumn1": QT
}
Response:
{
"status": "0",
"data": [
{
"QTActivity": "577.95"
}
],
"message": "Success"
}
GET /processes/{process}/scrapcauses/top
This method returns the active product.
Request parameters:
- company [mandatory]: the company name or id.
- session [mandatory]: the Id of the active session.
- process [mandatory]: the Id of the process.
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.
Content-Type: application/json Request: /processes/A0L1/scrapcauses/top?session=rB9RmQypCzdbiJjomQktYH2Uh8Rdljtal0Cn1ga1qjtRMKWyNNP405lyBs2h&company=DEMO01 Reponse (success): { "status": "0", "data": [ { "Scrap": "R0001 - Scrap" } ] "message": "Success" } |
GET /processes/{process}/speeds
This method returns the speed fields of information of a process.
Request attribute:
- Process [mandatory]: the id of the process
Request parameters:
- company [mandatory]: the company name or id.
- session [mandatory]: the Id of the active session.
- datefrom [mandatory]: start date of the period.
- dateto [mandatory]: end date of the period.
Response:
- status: returns "0" on success, and an error code in any other case.
- data: returns the various speed fields of the selected process.
- message: "success" or a descriptive information of the error in any other case.
Example:
Request:
{
/processes/A0L1/speeds
}
{
"session": 01qgmfcZmZ4nqg2eNGpxY4JlpmhJuKw1H31p5rtD1a112SSK8S8odROFIKgn
"company": DEMO04
“Datefrom”: 20171001000000
“Dateoto”: 20201110000000
}
Response:
{
"status": 0,
"Data":
{
"Speed0": "0",
"Speed0h": "0",
"SpeedR": "0",
"SpeedRh": "0",
"SpeedAvgR": "0",
"SpeedAvgRh": "0",
"SpeedT": "0",
"SpeedTh": "433.7349",
"SpeedT*S%": "0",
"SpeedT*S%h": "0",
"CycleTEquiv": "0"
}
"message": "Success"
}
GET /processes/{process}/speeds/class
This method returns the speed fields of information of a process, corresponding to the class.
Request attribute:
- Process [mandatory]: the id of the process
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 various speed fields of the selected process by class.
- message: "success" or a descriptive information of the error in any other case.
Example:
Request:
{
/processes/A0L1/speeds/class
}
{
"session": 01qgmfcZmZ4nqg2eNGpxY4JlpmhJuKw1H31p5rtD1a112SSK8S8odROFIKgn
"company": DEMO04
}
Response:
{
"status": "0",
"data": [
{
"SpeedWOClassh[
SpeedWOByClass": "0"
}
],
"message": "Success"
}
GET /processes/{process}/state
This method returns the current state information of a process: status, result and current order, date and time they changed, alerts information, current cycle time, etc. If the process is omitted, it will query for all processes, which could take longer. Be sure to put enough timeout.
Request attributes:
- process [optional]: process identifier.
Request parameters:
- company [mandatory]: The company name or id.
- session [mandatory]: The Id of the active session.
- showarea: displays the parent areas of the returned processes.
- showdescription: displays the description of the master data used: processes, areas, statuses and results.
- showfields: displays fields and field values belonging to the current result.
- showplanning: displays the next planned status with its planned date and time.
- device: displays the KPIs configures in the device.
Response:
- status: Returns "0" on success, and an error code in any other case.
- data: Returns current state information of the process.
- message: "Success" or a descriptive information of the error in any other case.
Example:
Request:
{"type":"get",
"url":"processes/A0L1",
"data":"company=demo01&session=lparIA3NO0TizbbcKdG3jrvmehoIoqkXLemLVkGmHtXBaPS9Pc152MXBMXu3&showdescription=1&showarea=1&showfields=1&showplanning=1&device=INIT"}
Reponse (success):
{"status":"0",
"data":[{"Id":"7101","NextPiece":"","Limit":"","Id_TUnext":"","Id_TUlimit":"","Id_TUSince":"20200824060000","Id_TU":"6301","PNSince":"20200720083753","PN":"2020040103-10","id_prodSince":"20200515095146","Id_Prod":"BB0932428102\/4351","Sch_Col":"0","Pro_Col":"0","Ti0_Col":"0","Ti1_Col":"0","Ti2_Col":"0","Co0_Col":"0","Co1_Col":"0","Co2_Col":"0","Aut_Col":"0","SPC0_Col":"0","SPC1_Col":"0","GQT_Col":"0","QuickUpd":"0","QUDateTime":"","CycleT":"2790780","CycleQ":"11","SPCReq":"","LastSentPR":"","LastResultId":"20200824105846AABCENTRAL","LastResultWhen":"20200821155056","LastResultPaused":"0","LastResultId_Paused":"","LastResultModified":"","TUTypeCurrent":"3","AvgCycleT":"15","AvgCycleQ":"4.07142E-07,"process":"RS15","status":"LIMPIEZA","result":"","areas":[{"id":"7100","description":"BOLSAS"}],"fields":[{"variable":"Lot","value":"BP2023082301"}],"next_id_tu":"","next_tu":"","next_id_tu_datetime":"","KPIs":{"Good (Unit)":{"type":"Number","value":"0","unit":"Piezas"},"Produced (un.)":{"type":"Number","value":"0","unit":"Piezas"},"Productive (Minutes)":{"type":"Number","value":"0","unit":"min"},"Not productive (Minutes)":{"type":"Number","value":"0","unit":"min"},"Nominal (un.\/Minutes)":{"type":"Number","value":"0","unit":"Piezas\/min"},"Average (un.\/Minutes)":{"type":"Number","value":"0","unit":"Piezas\/min"}}}],"message":"Success"}
Reponse (error):
{"status":1012,
"data":"<a href='http:\/\/127.0.0.1:8080\/edinnM2\/help\/en\/API_processes_state.html'>for additional information follow this link<\/a>",
"message":"Process not found"}
GET /processes/{process}/state/time
This method returns the relevant times ( such as the time in production) of a process over a selected time period, for a concrete state.
Request attribute:
- Process [mandatory]: the id of the process
Request parameters:
- company [mandatory]: the company name or id.
- session [mandatory]: the Id of the active session.
- datefrom [mandatory]: start date of the period.
- dateto [mandatory]: end date of the period.
Response:
- status: returns "0" on success, and an error code in any other case.
- data: returns the various time fields of the selected process for the given concrete state.
- message: "success" or a descriptive information of the error in any other case.
Example:
Request:
/processes/A0L1/state/time
{
"session": LzRlv4vjbyHWPhO2B2ulNjmSZFNmvpW4aqbLaoz1n6KJF91RJPCsZcmVLzpy
"company": DEMO04
“Datefrom”: 20171011000000
“Dateto”: 20201110000000
}
Reponse:
{
"status": "0",
"data": [
{
"TimeStatus[TimeStatus]": "0"
}
],
"message": "Success"
}
GET /processes/{process}/times
This method returns the relevant times ( such as the time in production) of a process over a selected time period.
Request attribute:
- Process [mandatory]: the id of the process
Request parameters:
- company [mandatory]: the company name or id.
- session [mandatory]: the Id of the active session.
- datefrom [mandatory]: start date of the period.
- dateto [mandatory]: end date of the period.
Response:
- status: returns "0" on success, and an error code in any other case.
- data: returns the various time fields of the selected process.
- message: "success" or a descriptive information of the error in any other case.
Example:
Request:
/processes/A0L1/times
{
"session": LzRlv4vjbyHWPhO2B2ulNjmSZFNmvpW4aqbLaoz1n6KJF91RJPCsZcmVLzpy
"company": DEMO04
“Datefrom”: 20171011000000
“Dateto”: 20201110000000
}
Response:
{
"status": 0,
"Data":
{
"TimeMin": "1621440",
"TimeNotProdHr": "1739.05055555556",
"TimeNotProdMin": "104343.033333333",
"TimeNowMin": "1632148",
"TimeProdMin": "857179.4",
"TimeProdHr": "14286.3233333333",
"TimeResMin": "-54575"
}
"message": "Success"
}