[jboss-user] [Beginner's Corner] - excel data into a drl

simscarlet do-not-reply at jboss.com
Tue Sep 22 05:37:36 EDT 2009


Hi,

I currently have a function in a rule which is an array of arrays that hold rating data. The issue I have is this is quite large and I want to hold this data in an external file and ie csv or excel and import it into the rule as a table. Is there a way I could store these values in excel and import ?
Here is an example of the function:

function double getValues(int row,int col) 	
{																

double[][] values = 
{


{10.00,	15.00,	10.00,	12.50,	10.00,	12.50,	7.50,	12.50,	10.00,	12.50,	10.00,	15.00,	14.00,	12.50,	12.50,	12.75,	15.00,	12.00,	11.00,	13.50,	14.60,	15.00,	12.50,	7.00,   15.00,  16.00,  15.00,  10.00,  7.00,  12.50,  12.75,  10.00,  15.00,  15.00}, //   0 -   99.99
{10.00,	15.00,	10.00,	12.50,	10.00,	12.50,	7.50,	12.50,	10.00,	12.50,	10.00,	15.00,	14.00,	12.50,	12.50,	12.75,	15.00,	12.00,	11.00,	13.50,	14.60,	15.00,	12.50,	7.00,   15.00,  16.00,  15.00,  10.00,  7.00,  12.50,  12.75,  10.00,  15.00,  15.00}, // 100 -  199.99
{10.00,	10.00,	10.00,	10.00,	10.00,	10.00,	7.50,	10.00,	10.00,	10.00,	10.00,	10.00,	10.00,	10.00,	10.00,	10.00,	10.00,	10.00,	10.00,	10.00,	10.00,	10.00,	10.00,	7.00,   10.00,  10.00,  10.00,  10.00,  7.00,  10.00,  10.00,  10.00,  10.00,  10.00}, // 200 -  299.99
{10.00,	10.00,	10.00,	10.00,	10.00,	10.00,	7.50,	10.00,	10.00,	10.00,	10.00,	10.00,	10.00,	10.00,	10.00,	10.00,	10.00,	10.00,	10.00,	10.00,	10.00,	10.00,	10.00,	7.00,   10.00,  10.00,  10.00,  10.00,  7.00,  10.00,  10.00,  10.00,  10.00,  10.00}, // 300 -  399.99
{10.00,	10.00,	10.00,	10.00,	10.00,	10.00,	7.50,	10.00,	10.00,	10.00,	10.00,	10.00,	10.00,	10.00,	10.00,	10.00,	10.00,	10.00,	10.00,	10.00,	10.00,	10.00,	10.00,	7.00,   10.00,  10.00,  10.00,  10.00,  7.00,  10.00,  10.00,  10.00,  10.00,  10.00}, // 400 -  499.99
{10.00,	10.00,	10.00,	10.00,	10.00,	10.00,	7.50,	10.00,	10.00,	10.00,	10.00,	10.00,	10.00,	10.00,	10.00,	10.00,	10.00,	10.00,	10.00,	10.00,	10.00,	10.00,	10.00,	7.00,   10.00,  10.00,  10.00,  10.00,  7.00,  10.00,  10.00,  10.00,  10.00,  10.00}, // 500 -  599.99
{10.00,	10.00,	10.00,	10.00,	10.00,	10.00,	7.50,	10.00,	10.00,	10.00,	10.00,	10.00,	10.00,	10.00,	10.00,	10.00,	10.00,	10.00,	10.00,	10.00,	10.00,	10.00,	10.00,	7.00,   10.00,  10.00,  10.00,  10.00,  7.00,  10.00,  10.00,  10.00,  10.00,  10.00}, // 600 -  699.99
{2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,   2.00,   2.00,   2.00,   2.00,   2.00,   2.00,   2.00,   2.00,   2.00,   2.00,   2.00}, // 700 -  799.99
{2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,   2.00,   2.00,   2.00,   2.00,   2.00,   2.00,   2.00,   2.00,   2.00,   2.00}, // 800 -  899.99
{2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,   2.00,   2.00,   2.00,   2.00,   2.00,   2.00,   2.00,   2.00,   2.00,   2.00}, // 900 -  999.99
{2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,   2.00,   2.00,   2.00,   2.00,   2.00,   2.00,   2.00,   2.00,   2.00,   2.00}, //1000 - 1099.99
{2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,   2.00,   2.00,   2.00,   2.00,   2.00,   2.00,   2.00,   2.00,   2.00,   2.00}, //1100 - 1199.99
{2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,   2.00,   2.00,   2.00,   2.00,   2.00,   2.00,   2.00,   2.00,   2.00,   2.00}, //1200 - 1299.99
{2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,   2.00,   2.00,   2.00,   2.00,   2.00,   2.00,   2.00,   2.00,   2.00,   2.00}, //1300 - 1399.99
{2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,   2.00,   2.00,   2.00,   2.00,   2.00,   2.00,   2.00,   2.00,   2.00,   2.00}, //1400 - 1499.99
{2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,   2.00,   2.00,   2.00,   2.00,   2.00,   2.00,   2.00,   2.00,   2.00,   2.00}, //1500 - 1599.99
{2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,	2.00,   2.00,   2.00,   2.00,   2.00,   2.00,   2.00,   2.00,   2.00,   2.00,   2.00}, //1600 - 

};

return values[row][col];
}


Thanks,
Simon.


View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4256337#4256337

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4256337



More information about the jboss-user mailing list