Duplicate Expression in the CalculationEngine

Dec 6, 2007 at 2:14 PM
Hi, because my expressions are user-made i have a situation where i can add to the calculation engine the same expression 2 times, i understand this is an error, i need direction of how to handle...

There is any way to know from the CalculationEngine if already exist an expression before add ?

Can the exception be changed from System.ArgumentException to a particular Flee exception so i can handle nicely ?

Can instruct the calculation engine to overwrite / ignore duplicate expressions ?

Other options ?

Stack trace of the Exception:

2007-12-06 12:05:34,484 10 DEBUG ConMega.Juridico.Biz.ResolucionConceptos (null) - Evaluando el concepto: ((TTR ), 1):Nombre Causa
2007-12-06 12:05:34,500 10 DEBUG ConMega.Juridico.Biz.ResolucionConceptos (null) - Expresion: (CarpetaEstudio_NombreCausa) -> CarpetaEstudio.NombreCausa
2007-12-06 12:05:34,765 10 DEBUG ConMega.Juridico.Biz.ResolucionConceptos (null) - Resultado: ACOSTA, ROSA ESTERR
2007-12-06 12:05:34,781 10 DEBUG ConMega.Juridico.Biz.ResolucionConceptos (null) - Evaluando el concepto: ((TTR ), 2):Apellido Abogado
2007-12-06 12:05:34,781 10 DEBUG ConMega.Juridico.Biz.ResolucionConceptos (null) - Expresion: (CarpetaEstudioAbogadoEncargadoApellido) -> CarpetaEstudio.AbogadoEncargado.Apellido
2007-12-06 12:05:34,984 10 DEBUG ConMega.Juridico.Biz.ResolucionConceptos (null) - Resultado: RUBERTO
2007-12-06 12:05:34,984 10 DEBUG ConMega.Juridico.Biz.ResolucionConceptos (null) - Evaluando el concepto: ((TTR ), 3):Calle Abogado
2007-12-06 12:05:34,984 10 DEBUG ConMega.Juridico.Biz.ResolucionConceptos (null) - Expresion: (CarpetaEstudioAbogadoCausaDomicilio_Calle) -> CarpetaEstudio.AbogadoCausa.Domicilio.Calle
2007-12-06 12:05:35,218 10 DEBUG ConMega.Juridico.Biz.ResolucionConceptos (null) - Resultado: SAN GERONIMO
2007-12-06 12:05:35,218 10 DEBUG ConMega.Juridico.Biz.ResolucionConceptos (null) - Evaluando el concepto: ((TTR ), 4):Expresion
2007-12-06 12:05:35,218 10 DEBUG ConMega.Juridico.Biz.ResolucionConceptos (null) - Expresion: (Concat) -> "Causa: " + CarpetaEstudioNombreCausa + Environment.NewLine + "Abogado: " + CarpetaEstudioAbogadoEncargado_Apellido
2007-12-06 12:05:35,250 10 DEBUG ConMega.Juridico.Biz.ResolucionConceptos (null) - Resultado: Causa: ACOSTA, ROSA ESTERR
Abogado: RUBERTO
2007-12-06 12:05:35,250 10 DEBUG ConMega.Juridico.Biz.ResolucionConceptos (null) - Evaluando el concepto: ((TTR ), 5):Carpeta Estudio.Nombre Causa
2007-12-06 12:05:35,250 10 DEBUG ConMega.Juridico.Biz.ResolucionConceptos (null) - Expresion: (CarpetaEstudio_NombreCausa) -> CarpetaEstudio.NombreCausa
2007-12-06 12:05:35,281 10 FATAL ConMega.Juridico.Config.Framework (null) - Excepción recibida.
System.ArgumentException: Ya se agregó un elemento con la misma clave.
en System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
en System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
en System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value)
en Ciloci.Flee.CalculationEngine.AddTemporaryHead(String headName)
en Ciloci.Flee.Expression`1..ctor(String expression, Object owner, ExpressionContext context)
en Ciloci.Flee.ExpressionFactory.CreateDynamic(String expression, Object owner, ExpressionContext context)
en Ciloci.Flee.ExpressionFactory.CreateDynamic(String expression, ExpressionContext context)
en ConMega.Juridico.Biz.ResolucionConceptos.Resolver() en C:\Proyectos\DotNet\Juridico\Thrunk\Biz\ConMega.Juridico.Biz\ConMega.Juridico.Biz\ResolucionConceptos.cs:línea 57
Coordinator
Dec 14, 2007 at 2:13 AM
I'll add a method to find out if an expression already exists in the engine in the next release.
Dec 14, 2007 at 3:31 PM
Thanks Eugene