Sepasoft SPC setCause - Error

Hi there,

I am using sepasoft SPC Module in Perspective. one issue I am facing is setting cause for a sample. If a sample fails then I would like QC to approve and provide notes which will be set as cause. I am using following script.

sampleUUID = '0000-000-0000-000000-00000'
sample = system.mes.spc.sample.getSample(sampleUUID)
cause = 'overfill'
userName = 'test'
attributeName = 'TestAttribute'
system.mes.spc.sample.setCause(sample, attributeName, cause, userName)

In Logs, SPCManager is giving an error. Error saving cause for sample.

Am i doing anything wrong?

Please advise .Thanks

@Matrix_Engineering would you be able to direct someone to this post please? from sepasoft expert. Thanks

@jesse.records

I just searched this forum for "sepasoft" and found posts where the logo is in the user profile pic.

1 Like

@Eagel007

Does that SampleUUID correlate to an existing sample in the system?

yes

The format and value look odd to me.
If you tried with the all zeros like your example you may have received an error like:

java.lang.NullPointerException: java.lang.NullPointerException: Cannot invoke "com.sepasoft.production.spc.sample.CommonSample.getDefUUID()" because "sample" is null

If the sample is valid, you should be able to print type(sample) from the script console:

sampleUUID = '0000-000-0000-000000-00000'
sample = system.mes.spc.sample.getSample(sampleUUID)
print type(sample)

Output:

<type 'com.sepasoft.quality.common.core.Sample'>