With the following post command, you can start or create an interruption if the "InterruptionId" is set to 0.
This command is based on "ue_interruption".
Property for the POST command |
Type |
Description |
action |
Edm.String |
Define Action Start -> Start interruption Stop -> Stop interruption |
ResourceId |
Edm.String |
The resource ID |
DocEntry |
Edm.Int32 |
The Interruption ID - =0 will create a new one - >0 will load the interruption ID for the resource and allow to modify the information |
InterruptionReasonId |
Edm.String |
The interruption reason ID |
ReasonInfo |
Edm.String |
The Reason Info; if it's empty we use the Reason text for the given Interruption Reason Id "InterruptionReasonId" |
ResourceType |
Edm.String |
Type of resource: resource/tool If it's empty we use "resource" |
Udf1..4 |
Edm.String |
User define fields from Udf1 to Udf4 |
PersonnelId |
Edm.String |
Set the personnel number starting the interruption |
PersonnelId_end |
Edm.String |
Set the personnel number ending the interruption |
BaseType |
Edm.String |
Linked to document mtc = maintenance |
PlanId |
Edm.Int32 |
Set the plan id for the maintenance order (see maintenancenr) |
DateTime_From |
Edm.Date |
Set the start date/time for the interruption |
DateTime_To |
Edm.Date |
Set the stop date/time for the interruption |
StatusId |
Edm.Int32 |
Set the status for this interruption: 1 - Planned 2 - Completed |
BaseDocNum |
Edm.Int32 |
The linked docnum/docentry |
BaseLine |
Edm.Int32 |
Interruption |
BaseLine2 |
Edm.Int32 |
|
MaintenanceNr |
Edm.Int32 |
You set a maintenance nr and the flag "BEAS_STILLSTANDGRUND"."CreateMaintenance" in the reason-settings is active, then beas create a maintenance order
if nr is empty, Beas gets the correct nr and planid automatically |
post Interruption
{
"action":"start",
"ResourceId":"1500",
"ResourceType":"resource",
"InterruptionId":0,
"InterruptionReasonId":"cleaning",
"ReasonInfo":"my text for the reason",
"Udf1":"",
"Udf2":"",
"Udf3":"",
"Udf4":"",
"PersonnelId":"",
"PersonnelId_end":"",
"BaseType":"",
"PlanId":"",
"DateTime_From":"",
"DateTime_To":"",
"StatusId":"",
"BaseDocNum":"",
"BaseLine":"",
"BaseLine2":"",
"MaintenanceNr":"",
}
Returnsyes
{
"DocEntry": 123,
"BaseType": "mtc",
"BaseDocNum": 456
}
Example simple Start:
{
"action":"start",
"ResourceId":"1500",
"ResourceType":"resource",
"InterruptionReasonId":"typ1",
"ReasonInfo":"my text for the reason",
"PersonnelId":"3",
"DateTime_From":"2019/05/27 10:00",
"DateTime_To":""
}
Example stop
Primary key is the resource and the reason id
if user and time not defined, the system will take current user and / or date / time.
{
"action":"stop",
"ResourceId":"1500",
"DocEntry":12344
}
Example: Close all open Interruptions for current employee
#jbs
let b=bsl.get("Interruption?$filter=Closed eq false&$select=ResourceId,DocEntry");
for (loop in b)
bsl.post("Interruption",{action:"stop",ResourceId:b.ResourceId[loop],DocEntry:(b.DocEntry[loop])});