system.mes.batch.phase.createPhase(name, inheritedFromLink, parentLink)

Sepasoft MES Module Suite

system.mes.batch.phase.createPhase(name, inheritedFromLink, parentLink)

Create a new phase object that can be further configured. Use the savePhase function to save the new phase. The new phase will have all of the capabilities of the inherited phase.

createPhase(name, inheritedFromLink, parentLink) → BatchPhase

Syntax

createPhase(name, inheritedFromLink, parentLink)

  • Parameters

String nameThe name of the new phase. Note, batch phase names must be globally unique.

MESObjectLink inheritedFromLink - A required link of an existing phase (built-in and user-defined) on which to base the new phase.

MESObjectLink parentLink - A required link to a parent BatchPhaseClass object. All user defined phases must be a child of a phase class.

  • Returns

A new unsaved BatchPhase object.

  • Scope

All

Create Phases By Script

This script:

  • Adds a Document Phase inside a Phase Class. Keep in mind that you can add user-defined phases with user-defined parameters.
  • Adds a user-defined parameter
  • Creates an MES Artifact on the BatchPhase object using an inherited AbstractMESObject method to add HTML5 content to a phase based on the Document phase-type.

Scripting Reference

Batch Script Functions
system.mes.batch.phase.getPhaseLink(name)
system.mes.batch.phase.savePhase(phase)
system.mes.batch.phase.getClassLink(name)
system.mes.batch.phase.createPhase(name, inheritedFromLink, parentLink)
Objects
BatchPhase
MESObjectLink

For Phase Parameter Properties, see Properties Common to All Phase Parameters.

Python
phaseName = 'myDocument'

defaultPhaseLink = system.mes.batch.phase.getPhaseLink('Document')

phaseClassName = 'Custom Phases'
phaseClassLink = system.mes.batch.phase.getClassLink(phaseClassName)

phase = system.mes.batch.phase.createPhase(phaseName, defaultPhaseLink, phaseClassLink)

#Add a parameter on the phase. See link to Properties Common to All Phase Properties above.
param = phase.addParameter('aStringParam')
param.setParamKindName('User Phase')
param.setParamDataTypeName('String')		
param.setParamValueSourceName('Recipe and Execution')
param.setParamRecordingTypeName('All to Object and History')
param.setParamValue('testvalue')

#for document phases there is an artifact
phase.createArtifact('documenttext','<html>Hello World!</html>')

system.mes.batch.phase.savePhase(phase)


Sepasoft MES Module Suite