lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi] Error message in do_interpolate_string_in_context()


From: Greg Chicares
Subject: [lmi] Error message in do_interpolate_string_in_context()
Date: Tue, 13 Feb 2018 22:18:13 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2

[Vadim--I think I've fixed this, but please take a look at SHA1 124129467]

When running inforce illustrations, Kim sees this message:
  Invalid value '3' of section 'InforceYear' at position 3226, only 
  "0" or "1" allowed
with ledger type mce_nasd, and this message:
  Invalid value '2' of section 'InforceYear' at position 3226, only 
  "0" or "1" allowed
with ledger type mce_ill_reg.

Steps to reproduce are the same as in my immediately preceding post,
except that the LedgerType is different.

These messageboxes appear reproducibly every time for Kim,
but never for me. She's using SHA1 a34d6122, whereas I'm at
71ec0e0b6; those are five commits apart, and the only code
difference is in CensusView::UponPasteCensus(), which is not
called here.

It seems that this message can arise only here:

$grep 'Invalid value' *.?pp         
interpolate_string.cpp:                                        << "Invalid 
value '"

I'm trying to see how far I can go without having reviewed
this code in detail; I don't feel confident changing it myself,
but I think the issue is that in 'illustration_reg.xsl'...

    <xsl:choose>
      <xsl:when test="$scalars/InforceYear!=0">
        Current Illustrated Crediting Rate:
        <xsl:call-template name="ultimate_interest_rate">
          <xsl:with-param name="counter" select="$scalars/InforceYear + 1"/>
        </xsl:call-template>
      </xsl:when>
      <xsl:otherwise>
        Current Illustrated Crediting Rate:
        <xsl:value-of select="$scalars/InitAnnGenAcctInt_Current"/>
      </xsl:otherwise>
    </xsl:choose>

...the test is whether InforceYear equals zero, but in 'reg_header.mst'...

            Current Illustrated Crediting Rate:
            {{#InforceYear}}
                {{UltimateInterestRate}}
            {{/InforceYear}}
            {{^InforceYear}}
                {{InitAnnGenAcctInt_Current}}
            {{/InforceYear}}
            <br>

...InforceYear is not transformed to boolean by comparing it to zero.
By analogy with "{{#InforceYearLE4}}" appearing immediately below that,
I speculate that we want to create a variable 'InforceYearEq0' and use
it in the MST snippet above.

How can it be that this is always reproducible for Kim but not for me?
I'm guessing that she might have changed the input EffectiveDate not
by one year as I did, but instead by more than one. And indeed if I
change the year part of that input field from 2018 to 2011, I see:
  Invalid value '7' of section 'InforceYear' [...]

I still can't see how this is possible with ledger type mce_nasd:

$grep --files-with-match InforceYear *.mst         
reg_header.mst

Perhaps one of us made a transcription typo; I'll ask her to confirm
that tomorrow.

Returning to the anomaly I can now reproduce, in commit a929271a
I already added InforceYearLE4, so I think I can fix this myself.
And...it looks like my fix worked, so I'll commit and push it.
I swapped the order of the MST "sections" in order to make the
controlling condition "if InforceYear == 0" instead of the less
natural "not equal to zero". I'm not at all sure of the semantics
of "InforceYear + 1" here:

    <xsl:call-template name="ultimate_interest_rate">
      <xsl:with-param name="counter" select="$scalars/InforceYear + 1"/>
    </xsl:call-template>

...where...

  <xsl:template name="ultimate_interest_rate">
    <xsl:param name="counter"/>
    <xsl:value-of 
select="address@hidden'AnnGAIntRate_Current']/duration[$counter]/@column_value"/>
  </xsl:template>

as opposed to here:

        add_variable
            ("UltimateInterestRate"
            ,evaluate("AnnGAIntRate_Current", invar.InforceYear + 1)
            );

because I'm not sure whether adding one is just compensating for
index-origin-one lookup in XSLT; I'll ask Kim to test that
carefully with an interest rate that varies every year, to make
sure we're picking up the right one.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]