How to convert Drools decision table (excel spread sheet) to a (.drl) file in Drools?

Եկեք փորձում է ստեղծել փոխարկել drools որոշումների սեղան (excel spread sheet) to a (.drl) file in Drools.
The SpreadsheetCompiler դասը օգտագործվում է փոխարկել մուտքագրման xls եւ CSV ֆայլը մի (.drl) ֆայլ. Պահանջվող փաթեթը “org.drools.decisiontable.SpreadsheetCompiler”.You need to use the compile () method of this class to do the conversion. Following example shows the processs.



Example program:-

ներմուծել java.io.FileInputStream;
Ներմուծման java.io.FileNotFoundException;
ներմուծել java.io.InputStream;
Ներմուծման org.drools.decisiontable.InputType;
Ներմուծման org.drools.decisiontable.SpreadsheetCompiler;

public class ExcelToDrlDemo {
հասարակական ստատիկ անվավեր հիմնական(Լարային args[]) {
// create an input stream
InputStream է = առ;
փորձել {
// assign the excel to the input stream
// mention the local directory path where your excel is kept
// you can take any decision table (excel sheet) for testing
է = նոր FileInputStream(“D:/Workspace/TestProj/src/ExamplePolicyPricing.xls”);
} բռնելը (FileNotFoundException e) {
e.printStackTrace();
}
// create compiler class instance
SpreadsheetCompiler SC = նոր SpreadsheetCompiler();
// compile the excel to generate the (.drl) ֆայլ
String drl=sc.compile(է, InputType.XLS);
// check the generated (.drl) ֆայլ
System.out.println(“Generate DRL file is –: “);
System.out.println(drl);
}
}


============================================= ============================================== Գնեք լավագույն տեխնոլոգիական գրքերը Amazon- ում,en,Էլեկտրականություն CT շագանակագույն էլեկտրաէներգիա,en
============================================== ---------------------------------------------------------------- electrician ct chestnutelectric
error

Enjoy this blog? Please spread the word :)

Follow by Email
LinkedIn
LinkedIn
Share