system.mes.createSchedule

Sepasoft MES Module Suite

system.mes.createSchedule(operationsDefinition)

Create a new MESOperationsSchedule from the specified operations definition that is used for scheduling. The Operations Schedule object will contain one or more linked Operations Requests, each with their associated Requests Segments. Note that the objects must be saved to be made manifest in the system.

Syntax

system.mes.createSchedule(operationsDefinition)

  • Parameters

MESOperationsDefinition  operationsDefinition - The operations definition to base the root operations request on.

  • Returns

A list containing a new operations schedule and all associated operations requests and request segments. The list is returned as a MESObjectList object that is a collection holding MES objects.

  • Scope

All

Python
#Load the operation definition object
operationsDefinition = system.mes.loadMESObject('Receive Turkeys', 'OperationsDefinition')

#Create a schedule for the specified operation 
schedule = system.mes.createSchedule(operationsDefinition)
##Print each item for verification purposes
for ndx in range(schedule.size()):
    print schedule.get(ndx)

#Set the date range
startDate = system.date.getDate(2017, 10, 11)       
startDate = system.date.setTime(startDate, 14, 0, 0) 
dueDate = system.date.addHours(startDate, 15)           
scheduleList = system.mes.scheduleOperations(schedule, startDate, dueDate, False, 'Active')  
 
##Save the schedule objects to make them manifest in the system.
system.mes.saveSchedule(scheduleList)

Output

Python
OperationsSchedule (b15be936-9c94-4334-a1be-3ad97d115c2a, Receive Turkeys Schedule, 0 parents, 0 children, 0 custom properties, 1 complex properties)
OperationsRequest (ea82b3ea-6fe3-4a65-94a5-55e34c0ff231, Receive Turkeys, 0 parents, 0 children, 0 custom properties, 2 complex properties)
RequestSegment (89f1698c-47f3-402e-a2d0-da49812d72f6, Receive Turkeys, 0 parents, 0 children, 0 custom properties, 6 complex properties)

Sepasoft MES Module Suite