[rules-users] String.format question in the RHS

Wolfgang Laun wolfgang.laun at gmail.com
Fri Aug 19 11:34:27 EDT 2011


Do not use dialect "mvel".
-W


2011/8/19 Dean Whisnant <dean at basys.com>

> Hello,****
>
> ** **
>
> Can anyone see an issue with the following RHS?  The String.format is
> failing.  I’ve copied it straight into java to verify my intentions and it
> works there.****
>
> ** **
>
> What I’m trying to accomplish is to concatenate the string UH005 with a
> sequence number that is a fixed 10 digits, zero filled.  So if
> CurrentClaimSeq_48 is the number 123, then I expect that TRN02_Check…  would
> be populated with UH0050000000123.****
>
> ** **
>
> Again, this is working fine in straight java, but not in a rule.  What am I
> missing?  Is there a better way to try to accomplish this in a rule?****
>
> ** **
>
> rule "L1000_TRN02_UHC_BPA"****
>
>     dialect "mvel"****
>
>     when****
>
>         CLM_835_SUPP( seq : currentClaimSeq_48 != ( null ) )****
>
>         CLM_DET_LOAD( )****
>
>         trn : x221TransactionHeader_TRN_ReassociationTraceNumber( )****
>
>     then****
>
>         trn.setTRN02_CheckOrEftTraceNumber( "UH005" + String.format (
> "%010d", seq) );****
>
> end****
>
> ** **
>
> ** **
>
> Here are the data types of the two fields involved.****
>
> ** **
>
> *private* Integer CurrentClaimSeq_48;****
>
> ** **
>
> *public* String TRN02_CheckOrEftTraceNumber;****
>
> ** **
>
> Thank you!****
>
> ** **
>
> Dean****
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20110819/c46033da/attachment.html 


More information about the rules-users mailing list