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

Sepasoft MES Module Suite

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

Return a link to the phase class 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 BatchPhaseClass object.

getClassLink(name) → MESObjectLink

Syntax

getClassLink(name)

  • Parameters

String - The name of the phase class.

  • Returns

The MESObjectLink object that represents the phase class.

  • 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