Skip to end of metadata
Go to start of metadata

The sample definition object holds all of the information defining a type of sample. A sample definition specifies the attributes to collect, the locations where sample data is collected from, the control limits that apply, and the signals that apply.

When samples are created, they are based on a sample definition. When sample measurement values are recorded, the sample definition is used to validate the measurement values. Other operations also refer back to the sample definition such as automatic scheduling of samples, auto evaluation of signals, etc.

A sub-set, 'helper' object, SPC Definition, that executes faster (doesn't load the entire Sample Definition object) can be loaded by the SPC Settings function, getDefinition(). See SPC Definition for a list of available function.

In script, this function creates and returns a new instance of a SampleDefinition object:


Properties


 getAutoApprove()
Description

Returns the default auto approve samples setting for this sample definition. Allowed locations that belong to this sample definition are initialized with this default setting.

Syntax

getAutoApprove() 


  • Parameters

None

  • Returns

 boolean autoApprove - True, if the default value of the auto approve setting for this sample definition is true and False otherwise.

 getComingDueMin()
Description

Returns the default coming due minutes setting for this sample definition. Allowed locations that belong to this sample definition are initialized with this default setting. The value represents the number of minutes required before a sample is due until the sample is considered coming due. For automatically scheduled samples, they are created prior to actual due time by the number of minutes of this setting.

Syntax

getComingDueMin() 


  • Parameters

None

  • Returns

 double comingDueMin - The number of minutes required before a sample is due until it is coming due.

 getDefUUID()
Description

Returns the UUID assigned to this sample definition. A UUID is a universally unique identifier that, once assigned to a sample definition, will never change. It is automatically generated when a sample definition is created and is unique in that no two samples definitions will have the same UUID.

Syntax

getDefUUID()


  • Parameters

None

  • Returns

String defUUID - The unique identifier allotted to this sample definition.

 getDescription()
Description

Returns the description of this sample definition.

Syntax

getDescription() 


  • Parameters

None

  • Returns

String description - The description given to this sample definition.

 getEnabled()
Description

Returns true if sample definition is enabled.

Syntax

getEnabled() 


  • Parameters

None

  • Returns

boolean True, if the sample definition is enabled and False otherwise.

 getId()
Description

Returns ID of the sample definition.

Syntax

getId()


  • Parameters

None

  • Returns

The ID of the sample definition. 

 getInterval()
Description

Returns the default interval for automatically scheduled samples based on this sample definition. Allowed locations that belong to this sample definition are initialized with this default interval. The units are defined by the Interval type defined for this sample definition.

Syntax

getInterval() 


  • Parameters

None

  • Returns

 double interval - The interval associated with this scheduled samples.

 getMeasurementCount()
Description

Returns the number of measurements that this sample definition is configured for.

Syntax

getMeasurementCount() 


  • Parameters

None

  • Returns

Integer measurementCount - The number of measurements associated with this sample definition.

 getName()
Description

Gets the name of this sample definition.

Syntax

getName()


  • Parameters

None

  • Returns

String name - The name of the sample definition.

 getOverdueMin()
Description

Returns the default overdue minutes setting for this sample definition. Allowed locations that belong to this sample definition are initialized with this default setting.

Syntax

getOverdueMin() 


  • Parameters

None

  • Returns

 double overdueMin - The value represents the number of minutes required after a sample is due until the sample is considered overdue.

 isModified()
Description

Returns true if this sample definition has been modified.

Syntax

isModified() 


  • Parameters

None

  • Returns

True, if the sample definition is modified.  

 isNew()
Description

Returns true if this sample definition is new.

Syntax

isNew() 


  • Parameters

None

  • Returns

  True if the specified sample definition is new.

 setAutoApprove(autoApprove)
Description

Sets the default auto approve samples setting for this sample definition. Allowed locations that belong to this sample definition are initialized with this default setting.

Syntax

setAutoApprove(autoApprove) 


  • Parameters

boolean autoApprove - The default value of auto approve setting for this sample definition is set to the desired boolean.

  • Returns

Nothing

 setComingDueMin(comingDueMin)
Description

Sets the default coming due minutes setting for this sample definition. Allowed locations that belong to this sample definition are initialized with this default setting. The value represents the number of minutes required before a sample is due until the sample is considered coming due. For automatically scheduled samples, they are created prior to actual due time by the number of minutes of this setting.

Syntax

setComingDueMin(comingDueMin) 


  • Parameters

double comingDueMin - The number of minutes required before a sample is due until it is coming due.

  • Returns

None

 setDefaultChart(defaultChart)
Description

Sets the default chart type to use with the current Sample Definition object.

Syntax

setDefaultChart(defaultChart) 


  • Parameters

String defaultChart - The default chart type to use with the current Sample Definition object. Options are: XBarR, XBarS, Individual, Mean, P, NP, C, U, Histogram, Pareto, Process Capability, Process Performance, Process Capability and Performance, and Box and Whisker.

  • Returns

Nothing

 setDescription(description)
Description

Sets the description of this sample definition.

Syntax

setDescription(description) 


  • Parameters

String description - The description given to this sample definition.

  • Returns

Nothing

 setEnabled(enabled)
Description

Sets sample definition enabled state.

Syntax

setEnabled(enabled) 


  • Parameters

boolean enabled - Set to True if the sample definition is to be enabled.

  • Returns

Nothing

 setInterval(interval)
Description

Sets the default interval for automatically scheduled samples. Allowed locations that belong to this sample definition are initialized with this default interval. The units are defined by the Interval type defined for this sample definition.

Syntax

setInterval(interval) 


  • Parameters

 double interval - The interval to be set for the specified samples.

  • Returns

Nothing

 setIntervalType(intervalType)
Description

Sets the default interval type for automatically scheduled samples. Allowed locations that belong to this sample definition are initialized with this default interval type. The return value must match those configured on the Quality tab for the enterprise in the Sample Interval list.

Syntax

setIntervalType(intervalType) 


  • Parameters

String intervalType - The interval type to be set for the specified samples.

  • Returns

Nothing

 setMeasurementCount(measurementCount)
Description

Sets this number of measurement to be used when creating samples based on the sample definition.

Syntax

setMeasurementCount(count) 


  • Parameters

Integer measurementCount - The number of measurements associated with this sample definition. If this value is zero, each Sample Definition Attribute may collect as many samples as is set in its Measurement Count property. If this value is non-zero, this number becomes the upper limit for the measurement count for each Sample Definition Attribute. Example: If this value is 5 and a Sample Definition Attribute's Measurement Count is set to 10, only 5 samples will be allowed to be collected.

  • Returns

Nothing

 setName(name)
Description

Sets a name for this sample definition.

It is recommended that once samples have been created using a specific name, it should not be changed.

Syntax

setName(name) 


  • Parameters

String name - Name to be set to the sample definition.

  • Returns

 Nothing

 setOverdueMin(overdueMin)
Description

Sets the default overdue minutes setting for this sample definition. Allowed locations that belong to this sample definition are initialized with this default setting. The value represents the number of minutes required after a sample is due until the sample is considered overdue.

Syntax

setOverdueMin(overdueMin) 


  • Parameters

 double overdueMin - The value represents the number of minutes required after a sample is due until the sample is considered overdue.

  • Returns

  Nothing


Attribute properties


 addAttribute(attribute)
Description

Adds a new attribute defined in the attribute parameter.

Syntax

addAttribute(attribute)


  • Parameters

SampleDefinitionAttribute attribute - The attribute to be added to the sample definition.

  • Returns

String result - Any error messages are returned, otherwise an empty string is returned.

 attributeExists(attribute)
Description

Returns true if the attribute specified in the parameter already exists for this sample definition. True will also be returned for disabled attributes.

Syntax

attributeExists(attribute)


  • Parameters

 SampleDefinitionAttribute attribute - The attribute to check the existence for.

  • Returns

 boolean True if the specified attribute exists and False otherwise.

 clearAttributes()
Description

All attributes contained in this sample definition are removed. Instead of the attributes being permanently removed, thier enabled flag is set to false.

Syntax

clearAttributes()


  • Parameters

None

  • Returns

Nothing

 getAllAttributes()
Description

Returns a list of all attributes associated with this sample definition. This function will return enabled and disabled attributes.

Syntax

getAllAttributes()


  • Parameters

None

  • Returns

A list of SampleDefinitionAttribute Objects for this sample definition.

 getAttribute(id)
Description

Returns the attribute specified by the id parameter.

Syntax

getAttribute(id)


  • Parameters

Integer id - The identifier of the sample definition to return for.

  • Returns

 SampleDefinitionAttribute - The sample definition attribute object specified by the id parameter.

 getAttribute(name)
Description

Returns the attribute with the same name as the name parameter.

Syntax

getAttribute(name)


  • Parameters

String name - Name of the attribute to be returned for.

  • Returns

SampleDefinitionAttribute - The attribute specified by the name parameter.

 getEnabledAttributes()
Description

Returns a list of all attributes associated with this sample definition. This function will return only enabled attributes.

Syntax

getEnabledAttribute()


  • Parameters

None

  • Returns

 List<SampleDefinitionAttribute> - A list of all attributes for this sample definition.

 removeAttribute(attribute)
Description

Removes the attribute defined in the attribute parameter. Instead of attributes being permanently removed, their enabled flag is set to false. Any error messages are returned, otherwise an empty string is returned.

Syntax

removeAttribute(attribute)


  • Parameters

SampleDefinitionAttribute attribute - The attribute to be removed from this sample definition.

  • Returns

String result - If the attribute is successfully removed, then a message "Attribute not found" will be returned.

 removeAttribute(index)
Description

Removes the attribute defined in the index parameter. Instead of attributes being permanently removed, thier enabled flag is set to false. Any error messages are returned, otherwise an empty string is returned.

Syntax

removeAttribute(index)


  • Parameters

int index - The index of the attribute to be removed from this sample definition.

  • Returns

String result - If the attribute is successfully removed, then a message "Attribute not found" will be returned.

 removeAttribute(name)
Description

Removes the attribute defined in the name parameter. Instead of attributes being permanently removed, their enabled flag is set to false. Any error messages are returned, otherwise an empty string is returned.

Syntax

removeAttribute(name)


  • Parameters

String name - The name of the attribute to be removed from this sample definition.

  • Returns

String result - If the attribute is successfully removed, then a message "Attribute not found" will be returned.

Allowed location properties:


 addAllowedLocation(location)
Description

Adds a new allowed location defined in the location parameter. By adding an allowed location to this sample definition, this type of sample will appear as an option for the location and the real time location will be saved along with associated samples. For example, shift, product code, ref No and additional factor information is saved along with the sample data.

Syntax

addAllowedLocation(location)


  • Parameters

SampleDefinitionLocation location - The location to be added to this sample definition.

  • Returns

String result - Any error messages are returned, otherwise an empty string is returned.

 allowedLocationExists(location)
Description

Returns true if the allowed location specified in the parameter already exists for this sample definition. True will also be returned for allowed locations that have been removed, but not committed by saving the sample definition.

Syntax

allowedLocationExists(location)


  • Parameters

 SampleDefinitionLocation  location - The location to check the existence for.

  • Returns

boolean True if the location exist and False otherwise.

 clearAllowedLocations()
Description

All allowed locations contained in this sample definition are removed. Allowed locations are permanently removed but can be added back. SPC data is not lost and will appear in the control charts and analysis.

Syntax

clearAllowedLocations()


  • Parameters

None

  • Returns

Nothing

 getAllAllowedLocations(includeRemoved)
Description

Returns a list of all allowed locations associated with this sample definition. If the includeRemoved parameter is true, the results will include removed allowed locations that have not been committed by saving the sample definition.

Syntax

getAllAllowedLocations(includeRemoved)


  • Parameters

boolean includeRemoved - Set it to True if the results should include the removed locations and False otherwise.

  • Returns

List of Sample Definition Location - A list of all the locations associated with this sample definition is returned.

 getAllowedLocation(name)
Description

Returns the allowed location with the same name as the name parameter.

Syntax

getAllowedLocation(name)


  • Parameters

String name - The name of the location to return for.

  • Returns

SampleDefinitionLocation - The sample definition location object specified by the name parameter.

 removeAllowedLocation(index)
Description

Removes the allowed location defined by the index parameter. Allowed locations are permanently removed but can be added back. SPC data is not lost and will appear in the control charts and analysis.

Syntax

removeAllowedLocation(index)


  • Parameters

int index - The index of location to be removed for.

  • Returns

String result - Any error messages are returned, otherwise an empty string is returned.

 removeAllowedLocation(location)
Description

Removes the allowed location defined in the location parameter. Allowed locations are permanently removed but can be added back. SPC data is not lost and will appear in the control charts and analysis.

Syntax

removeAllowedLocation(location)


  • Parameters

SampleDefinitionLocation location - The location to be removed from this sample definition.

  • Returns

String result - Any error messages are returned, otherwise an empty string is returned.

 removeAllowedLocation(locationName)
Description

Removes the allowed location defined by the name parameter. Allowed locations are permanently removed but can be added back. SPC data is not lost and will appear in the control charts and analysis.

Syntax

removeAllowedLocation(locationName)


  • Parameters

String locationName - The name of location to be removed for.

  • Returns

String result - Any error messages are returned, otherwise an empty string is returned.

Control limit properties



 addControlLimit(controlLimit)
Description

Adds a new control limit defined in the controlLimit parameter. By adding a control limit to this sample definition, it will show as an option in the control charts and may also be used when evaluating signals. The controlLimit parameter must be a valid control limit that appears in the enterprise production item. Any error messages are returned, otherwise an empty string is returned.

Syntax

addControlLimit(controlLimit)


  • Parameters

SampleDefinitionControlLimit controlLimit - The control limit to be added.

  • Returns

String controlLimit - Sample control limit with the same name or ID already exists.

 clearControlLimits()
Description

All control limits contained in this sample definition are removed.

Syntax

clearControlLimits()


  • Parameters

None

  • Returns

Nothing

 controlLimitExists(controlLimit)
Description

Returns true if the control limit specified in the parameter already exists for this sample definition.

Syntax

controlLimitExists(controlLimit)


  • Parameters

SampleDefinitionControlLimit contolLimit - The control limit to check for existence.

  • Returns

True, if the specified control limit exist.

 getAllAllowedLocations(includeRemoved)
Description

Returns a list of all allowed locations associated with this sample definition. If the includeRemoved parameter is true the results will include removed allowed locations that have not been committed by saving the sample definition.

Syntax

getAllAllowedLocations(includeRemoved)


  • Parameters

boolean includeRemoved - True if the allowed locations that has been removed to be included.

  • Returns

A list of all allowed locations associated with the sample definition.

 getAllControlLimits()
Description

Returns all control limits that have been selected for this sample definition.

Syntax

getAllControlLimits()


  • Parameters

None

  • Returns

A list of all control limits for the sample definition.

 getControlLimit(name)
Description

Returns the control limit that has the same name as the name parameter.

Syntax

getControlLimit(name)


  • Parameters

String name - Name of the control limit.

  • Returns

SampleDefinitionControlLimit control limit - The control limit with the specified name.

 removeControlLimit(controlLimit)
Description

Removes the control limit defined in the controlLimit parameter.

Syntax

removeControlLimit(controlLimit)


  • Parameters

SampleDefinitionControlLimit controlLimit - The control limit to be removed.

  • Returns

Any error messages are returned, otherwise an empty string is returned.

 removeControlLimit(controlLimitName)
Description

Removes the control limit defined in the controlLimitName parameter. 

Syntax

removeControlLimit(controlLimitName)


  • Parameters

String controlLimitName - Name of the control limit to be removed.

  • Returns

Any error messages are returned, otherwise an empty string is returned.

 removeControlLimit(index)
Description

Removes the control limit defined in the index parameter.

Syntax

removeControlLimit(index)


  • Parameters

int index - The index of the control limit to remove for.

  • Returns

Any error messages are returned, otherwise an empty string is returned.


Signal properties


 addSignal(signal)
Description

Adds a new signal defined in the signal parameter. By adding a signal to this sample definition, it will show as an option in the control charts and may also be automatically evaluated. The signal parameter must be a valid signal that appears in the enterprise production item.

Syntax

addSignal(signal)


  • Parameters

SampleDefinitionSignal signal - The new signal to be added.

  • Returns

Any error messages are returned, otherwise an empty string is returned.

 clearSignals()
Description

All signals contained in this sample definition are removed.

Syntax

clearSignals()


  • Parameters

None

  • Returns

Nothing

 getAllSignals()
Description

Return all signals that have been selected for this sample definition.

Syntax

getAllSignals()


  • Parameters

None

  • Returns

A List of all signals for the sample definition.

 getSignal(name)
Description

Returns the signal that has the same name as the name parameter.

Syntax

getSignal(name)


  • Parameters

String name - The name of the signal to be returned for.

  • Returns

SampleDefinitionSignal - The sample definition signal object specified by the name parameter.

 removeSignal(index)
Description

Removes the signal defined in the index parameter. 

Syntax

removeSignal(index)


  • Parameters

int index - The index of the signal to be removed.

  • Returns

Any error messages are returned, otherwise an empty string is returned.

 removeSignal(signal)
Description

Removes the signal defined in the signal parameter.

Syntax

removeSignal(signal)


  • Parameters

SampleDefinitionSignal signal - The signal to be removed.

  • Returns

Any error messages are returned, otherwise an empty string is returned.

 removeSignal(signalName)
Description

Removes the signal defined in the signalName parameter. 

Syntax

removeSignal(signalName)


  • Parameters

int signalName - The name of the signal to be removed.

  • Returns

Any error messages are returned, otherwise an empty string is returned.

 signalExists(signal)
Description

Returns true if the signal specified in the parameter already exists for this sample definition.

Syntax

signalExists(signal)


  • Parameters

SampleDefinitionSignal signal - The signal to check the existence for.

  • Returns

True, if there exist the specified signal.




  • No labels