system.mes.batch.phase.getPhaseLink(name)

Sepasoft MES Module Suite

system.mes.batch.phase.getPhaseLink(name)

Return a link to the batch phase specified by the name parameter. Links are lightweight and hold the key information of an MES Object and link.getMESObject() can be used to get the actual BatchPhase object.

getPhaseLink(name) → MESObjectLink

Syntax

getPhaseLink(name)

  • Parameters

String name - The name of the batch phase. Note, batch phase names must be globally unique.

  • Returns

The MESObjectLink for the batch phase.

  • 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