[rules-users] string tokenizer import issue in drl

vysrinivas vysrinivas at gmail.com
Mon Jun 11 11:18:34 EDT 2012


Hi Laune,

Thanks for your reply.

Please find the java code which has to be incorporated in drl file.

could you please give the respective drool code for the same. Version of
drools is 2.0.

class pricing {
	public static void main(String args[]) {

		String subsrtComment = null;
		String note = " QTYPE=PRICE|QSTATUS=YES ";
		String QType = null;
		note = note.trim();
		if (note.contains("QTYPE")) {
			int ind1 = note.indexOf("QTYPE");
			String subsrt = note.substring(ind1);

			if (subsrt.contains("|")) {
				int ind2 = subsrt.indexOf("|");
				QType = subsrt.substring(0, ind2).trim();
			} else {
				QType = note.substring(ind1).trim();
			}
			subsrtComment = QType.substring(QType.indexOf("=") + 1).trim();
			if (subsrtComment.length() > 0) {
				subsrtComment=subsrtComment.substring(0, 5);
				System.out.println("substr1="+subsrtComment);
			} else {
				subsrtComment = null;
				System.out.println("substr2="+subsrtComment);
			}
		} else {
			subsrtComment = null;
			System.out.println("substr3="+subsrtComment);
		}

	}
}


--
View this message in context: http://drools.46999.n3.nabble.com/string-tokenizer-import-issue-in-drl-tp4017845p4017847.html
Sent from the Drools: User forum mailing list archive at Nabble.com.


More information about the rules-users mailing list