Skip to Content
avatar image
Former Member

Hard coding an approval limit

Hi All,

I have been looking at hard coding an approval limit into some Project workflow prescript but I am having issues using compareTo with my limit.

I have been trying to use the below code:

import java.math.*;

// Get estimated value price

estvalueprice = doc.getEstimatedValue().getPrice();

// Set approval limit

limit = 200000;

// compare estimated value price against the approval limit

if (hasValue(estvalueprice) @and

   estvalueprice.compareTo(limit) < 0)

{

// add approver

}

Using this code I am getting an error when importing the XPDL file which is showing in the log as “Error parsing script”. Do I need to convert the limit before using it in a compare?

Many thanks

Dan

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Apr 16, 2012 at 01:06 AM

    Hi Dan,

    limit should be a BigDecimal. Try this...

    BigDecimal limit = new BigDecimal(200000.00);

    Regards,

    Vikram

    Add comment
    10|10000 characters needed characters exceeded