outputResultJSON of Operator does not update entity of schedule if entity is not instance of Job

parent 6acc02ef
......@@ -303,7 +303,9 @@ class Operator(ObjectResource):
if record.get("exitTime", None) != None:
json['results']['schedule'][-1]["exitTime"] = record["exitTime"]
if record.get("entity", None):
json['results']['schedule'][-1]["entityId"] = record["entity"].id
from Job import Job
if issubclass(record["entity"].__class__, Job):
json['results']['schedule'][-1]["entityId"] = record["entity"].id
if record.get("task_id", None):
json['results']['schedule'][-1]["task_id"] = record["task_id"]
G.outputJSON['elementList'].append(json)
......
......@@ -83,13 +83,11 @@
],
"schedule": [
{
"entityId": "P1",
"entranceTime": 0,
"exitTime": 17.0,
"stationId": "M1"
},
{
"entityId": "P1",
"entranceTime": 20.0,
"exitTime": 22.0,
"stationId": "M2"
......
......@@ -92,8 +92,7 @@
],
"schedule": [
{
"entityId": "Batch22047",
"entranceTime": 0,
"entranceTime": 0.0,
"stationId": "M1"
}
],
......@@ -115,13 +114,11 @@
],
"schedule": [
{
"entityId": "Batch22048",
"entranceTime": 0,
"exitTime": 80.0,
"stationId": "M2"
},
{
"entityId": "Batch22049",
"entranceTime": 80.0,
"stationId": "M2"
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment