Author Message
AdamHunt
Joined: Nov 22, 2013
Messages: 0
Offline
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);
ShwetaBehere
Joined: Dec 23, 2013
Messages: 136
Offline
You should see an error if you call getComplexVariable on a simple variable. You are using a very old version of DD, so there might be some issues. Please use the latest version (OD 6.0) to get the latest bug fixes and new features.
AdamHunt
Joined: Nov 22, 2013
Messages: 0
Offline
Thanks! We are trying to upgrade the code base to OD 6.0, however, like I mentioned, I am just inheriting the original code, and wanted to confirm that calling getComplexVariable will throw an error if called on a simple variable. I didn't think that was possible to do successfully, and you have confirmed that.
Go to:   
Mobile view