Class ClientScriptingFunctions
- java.lang.Object
-
- com.inductiveautomation.sfc.client.scripting.ClientScriptingFunctions
-
- All Implemented Interfaces:
SfcScriptingFunctions
public class ClientScriptingFunctions extends java.lang.Object implements SfcScriptingFunctions
-
-
Constructor Summary
Constructors Constructor Description ClientScriptingFunctions()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcancelChart(java.util.UUID instanceId)Cancels the chart instance indicated byinstanceId.voiddebugResume(java.util.UUID instanceId)Sends a message to the chart instance stopped at a breakpoint to resume normal operations.voiddebugStep(java.util.UUID instanceId)Sends a message to the chart instance stopped at a breakpoint to step to the next step.java.util.List<ChartInfo>getRunningCharts()Returns information about the currently running charts.java.util.List<ChartInfo>getRunningCharts(java.lang.String chartPath)Returns information about the currently running instances of a given chart path.PyChartScopegetVariables(java.util.UUID instanceId)Returns the chart scope for the specified instance.voidpauseChart(java.util.UUID instanceId)Pause the chart instance indicated byinstanceId.voidredundantCheckpoint(java.util.UUID instanceId)For charts that have the "redundancy sync" setting enabled, this method synchronizes chart and step variables of the specified chart instance across the redundant cluster, allowing the instance to continue where it left off if a redundant failover occurs.voidresumeChart(java.util.UUID instanceId)Resume the chart instance indicated byinstanceId.voidsetVariables(java.util.UUID instanceId, java.util.UUID stepId, org.python.core.PyObject variablesMap)voidsetVariables(java.util.UUID instanceId, org.python.core.PyObject variablesMap)Updates the chart indicated byinstanceIdby copying all of the variables from the providedvariableMapinto the chart's scope.java.util.UUIDstartChart(java.lang.String projectName, java.lang.String chartPath, java.util.Map<java.lang.String,java.lang.Object> parameters)Start a Chart in ProjectprojectNamefrom the definition atchartPath.java.util.UUIDstartChart(java.lang.String chartPath, java.util.Map<java.lang.String,java.lang.Object> parameters)Start a chart in ProjectProject.GLOBAL_PROJECT_NAMEfrom the definition atchartPath.
-
-
-
Method Detail
-
startChart
public java.util.UUID startChart(java.lang.String chartPath, java.util.Map<java.lang.String,java.lang.Object> parameters) throws java.lang.ExceptionDescription copied from interface:SfcScriptingFunctionsStart a chart in ProjectProject.GLOBAL_PROJECT_NAMEfrom the definition atchartPath.- Specified by:
startChartin interfaceSfcScriptingFunctions- Parameters:
chartPath- the path to the chart definition.parameters- the parameters passed to the chart scope.- Returns:
- The
UUIDof the running chart instance. - Throws:
java.lang.Exception
-
startChart
public java.util.UUID startChart(java.lang.String projectName, java.lang.String chartPath, java.util.Map<java.lang.String,java.lang.Object> parameters) throws java.lang.ExceptionDescription copied from interface:SfcScriptingFunctionsStart a Chart in ProjectprojectNamefrom the definition atchartPath.- Specified by:
startChartin interfaceSfcScriptingFunctions- Parameters:
projectName- the name of the project the chart definition resides in.chartPath- the path to the chart definition.parameters- the parameters passed to the chart scope.- Returns:
- The
UUIDof the running chart instance. - Throws:
java.lang.Exception
-
cancelChart
public void cancelChart(java.util.UUID instanceId) throws java.lang.ExceptionDescription copied from interface:SfcScriptingFunctionsCancels the chart instance indicated byinstanceId.- Specified by:
cancelChartin interfaceSfcScriptingFunctions- Parameters:
instanceId- theUUIDof the chart instance to stop.- Throws:
java.lang.Exception
-
pauseChart
public void pauseChart(java.util.UUID instanceId) throws java.lang.ExceptionDescription copied from interface:SfcScriptingFunctionsPause the chart instance indicated byinstanceId.- Specified by:
pauseChartin interfaceSfcScriptingFunctions- Parameters:
instanceId- theUUIDof the chart instance to pause.- Throws:
java.lang.Exception
-
resumeChart
public void resumeChart(java.util.UUID instanceId) throws java.lang.ExceptionDescription copied from interface:SfcScriptingFunctionsResume the chart instance indicated byinstanceId.- Specified by:
resumeChartin interfaceSfcScriptingFunctions- Parameters:
instanceId- theUUIDof the chart instance to resume.- Throws:
java.lang.Exception
-
debugStep
public void debugStep(java.util.UUID instanceId) throws java.lang.ExceptionDescription copied from interface:SfcScriptingFunctionsSends a message to the chart instance stopped at a breakpoint to step to the next step.- Specified by:
debugStepin interfaceSfcScriptingFunctions- Throws:
java.lang.Exception
-
debugResume
public void debugResume(java.util.UUID instanceId) throws java.lang.ExceptionDescription copied from interface:SfcScriptingFunctionsSends a message to the chart instance stopped at a breakpoint to resume normal operations.- Specified by:
debugResumein interfaceSfcScriptingFunctions- Throws:
java.lang.Exception
-
getRunningCharts
public java.util.List<ChartInfo> getRunningCharts() throws java.lang.Exception
Description copied from interface:SfcScriptingFunctionsReturns information about the currently running charts.- Specified by:
getRunningChartsin interfaceSfcScriptingFunctions- Returns:
- Chart information about all of the currently running charts.
- Throws:
java.lang.Exception
-
setVariables
public void setVariables(java.util.UUID instanceId, org.python.core.PyObject variablesMap)Description copied from interface:SfcScriptingFunctionsUpdates the chart indicated byinstanceIdby copying all of the variables from the providedvariableMapinto the chart's scope.- Specified by:
setVariablesin interfaceSfcScriptingFunctions- Parameters:
instanceId- the of the chart instance to update.variablesMap- a dictionary containing key-value pairs of serializable things to update in chart scope.
-
setVariables
public void setVariables(java.util.UUID instanceId, java.util.UUID stepId, org.python.core.PyObject variablesMap)- Specified by:
setVariablesin interfaceSfcScriptingFunctions
-
getRunningCharts
public java.util.List<ChartInfo> getRunningCharts(java.lang.String chartPath) throws java.lang.Exception
Description copied from interface:SfcScriptingFunctionsReturns information about the currently running instances of a given chart path.- Specified by:
getRunningChartsin interfaceSfcScriptingFunctions- Throws:
java.lang.Exception
-
getVariables
public PyChartScope getVariables(java.util.UUID instanceId) throws java.lang.Exception
Description copied from interface:SfcScriptingFunctionsReturns the chart scope for the specified instance. Step scopes for active steps are found under the "activeSteps" key.- Specified by:
getVariablesin interfaceSfcScriptingFunctions- Throws:
java.lang.Exception
-
redundantCheckpoint
public void redundantCheckpoint(java.util.UUID instanceId) throws java.lang.ExceptionDescription copied from interface:SfcScriptingFunctionsFor charts that have the "redundancy sync" setting enabled, this method synchronizes chart and step variables of the specified chart instance across the redundant cluster, allowing the instance to continue where it left off if a redundant failover occurs.- Specified by:
redundantCheckpointin interfaceSfcScriptingFunctions- Parameters:
instanceId- the UUID of the chart instance to update.- Throws:
java.lang.Exception- if the redundant peer is not set up or connected, or if the chart does not have redundancy sync enabled.
-
-