Skip to Content
author's profile photo Former Member
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


Add comment
10|10000 characters needed characters exceeded

1 Answer

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

    Hi Dan,

    limit should be a BigDecimal. Try this...

    BigDecimal limit = new BigDecimal(200000.00);



    Add comment
    10|10000 characters needed characters exceeded