I am working on updating a 4.1 DD app to 6.0, and I am seeing the following error:
Capturing exception [com.avaya.sce.runtimecommon.VariableTypeException]. Message [Variable is simple cannot convert to complex]
I believe that this is coming from the fact that CAT_EVENTS is a simple project variable, and the error is thrown when calling the getComplexVariable method on it. I am taking this code over from someone else, so I did not code this, but was told that this is currently working in production in its 4.1 DD version. My main question is, is it possible that this does not cause an error, and if not, am I correct in my analysis that calling that method on a non-complex (simple) variable, would always throw an error?
// ivrData is a collection of XML strings built from all
// caller responses
ICollection c;
IVariable v = sesn.getVariable(IProjectVariables.IVR_DATA);
IVariableField f = v.getSimpleVariable();
c = new SimpleCollection(f, IProjectVariables.IVR_DATA);
v.setCollection(c);
// catastrophic events from the DedicatedTransfers.xml file
v = sesn.getVariable(IProjectVariables.CAT_EVENTS);
IComplexVariable cv = v.getComplexVariable();
c = new ComplexCollection(cv, IProjectVariables.CAT_EVENTS);
v.setCollection(c);
|