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.
ชั้น SpreadsheetCompiler ใช้ในการแปลง XLS ป้อนข้อมูลและไฟล์ CSV ไป (.DRL) ไฟล์. แพคเกจที่จำเป็น “org.drools.decisiontable.SpreadsheetCompiler”.คุณจำเป็นต้องใช้คอมไพล์ () วิธีการของชั้นนี้ที่จะทำแปลง. ตัวอย่างต่อไปนี้แสดงให้เห็น processs.



Example program:-

นำเข้า java.io.FileInputStream;
java.io.FileNotFoundException นำเข้า;
นำเข้า java.io.InputStream;
org.drools.decisiontable.InputType นำเข้า;
org.drools.decisiontable.SpreadsheetCompiler นำเข้า;

เรียนสาธารณะ ExcelToDrlDemo {
ประชาชนเป็นโมฆะหลักแบบคงที่(String args[]) {
// สร้างกระแสการป้อนข้อมูล
InputStream คือ = null;
ดู {
// กำหนด Excel เพื่อสตรีมใส่
// พูดถึงเส้นทางไดเรกทอรีท้องถิ่นที่ Excel ของคุณจะถูกเก็บไว้
// คุณสามารถใช้ตารางการตัดสินใจใด ๆ (excel แผ่น) สำหรับการทดสอบ
= new FileInputStream เป็น(“D:/พื้นที่ทำงาน / TestProj / src / ExamplePolicyPricing.xls”);
} จับ (e FileNotFoundException) {
e.printStackTrace();
}
// สร้างตัวอย่างคลาสคอมไพเลอร์
SpreadsheetCompiler sc = SpreadsheetCompiler ใหม่();
// รวบรวม Excel ในการสร้าง (.DRL) ไฟล์
String = ตะโกน sc.compile(เป็น, InputType.XLS);
// ตรวจสอบที่เกิด (.DRL) ไฟล์
System.out.println(“สร้างไฟล์ DRL คือ –: “);
System.out.println(DRL);
}
}


============================================= ============================================== ซื้อหนังสือ techalpine ที่ดีที่สุดใน Amazon,en,ช่างไฟฟ้า CT Chestnutelectric,en
============================================== ---------------------------------------------------------------- electrician ct chestnutelectric
error

Enjoy this blog? Please spread the word :)

Follow by Email
LinkedIn
LinkedIn
Share