|
Á¦ ¸ñ |
JRules 3.1 ilr parsing½Ã IlrObjectValue.. |
|
ÀÛ¼ºÀÚ |
ÀÌ¿ìÇ× |
ÀÛ¼ºÀÏ |
2001-09-17 |
Á¶È¸¼ö |
1592 ȸ |
|
÷ºÎÆÄÀÏ |
÷ºÎµÈ ÆÄÀϾøÀ½.
|
|
¾È³çÇϼ¼¿ä? Á¤¸» ¿À·§¸¸À̳׿ä...^^
Áú¹®¿¡ ´ëÇÑ ´äº¯Àº ¾Æ·§ ¼Ò½º¸¦ Âü°í Çϼ¼¿ä. ±×¸®°í, Factory API¸¦ ÀÌ¿ëÇÏ¿© ¾Æ·¡¿Í °°ÀÌ ·êÀ» ÆíÁýÇÏ´Â °Íµµ °¡´ÉÇÕ´Ï´Ù¸¸, ILOG JRules¿¡¼ Á¦°øÇÏ´Â Business Rule Language¸¦ ÀÌ¿ëÇÏ¿© »ç¿ëÀÚ°¡ ½±°Ô ·êÀ» ÆíÁýÇÒ ¼ö ÀÖ½À´Ï´Ù. ÇÑ ¹ø °ËÅäÇØº¸½Ã±â ¹Ù¶ø´Ï´Ù.
:IlrUnaryTest test = (IlrUnaryTest)obj; :if(test.getArgument() instanceof IlrMethodInvocation) { : IlrMethodInvocation arg = : (IlrMethodInvocation)test.getArgument(); : Object argObj = arg.getObject(); : String columnName = null; : if(argObj instanceof IlrMethodInvocation) { : IlrMethodInvocation arg_1 = (IlrMethodInvocation)argObj;
/////////////////////////////////////// String methodName = arg_1.getMethod().getName(); Class returnType = arg_1.getMethod().getReturnType(); System.out.println(\"method name is \"+methodName); System.out.println(\"return type \"+returnType.getName()); IlrValue[] args = arg_1.getArguments(); for(int i=0; i System.out.println(i+\" argument type = \"+args[i].getType().getName());//+argTypes[i].toString()); } //////////////////////////////////////////
: Object argObj_1 = arg_1.getObject(); : String columnName_1 = null; : if(argObj_1 instanceof IlrObjectValue) { : // : // ¹®Á¦´Â ¿©±â.. : // IlrObjectValue¿¡¼ ¾î¶»°Ô method ÀÇ À̸§À̳ª : // argument Á¤º¸, ŸÀÔ : // return Á¤º¸, ŸÀÔ µî ÇÊ¿äÇÑ Á¤º¸¸¦ ²¨³»¿Ã¼ö ÀÖ³ª¿ä? : // : }
:³²ÀÎÀç´ÔÀÇ ±ÛÀÔ´Ï´Ù.
:¾È³çÇϼ¼¿ä~ :¿À·£¸¸¿¡ µé¾î¿Ô´õ´Ï~ È~¾Ç ¹Ù²î¾ú³×¿ä? :À½~ : :¿ì¼± Á¦°¡ ÇϰíÀÚ ÇÏ´Â °ÍÀº :ilr ÈÀÏÀ» parsing ÇØ¼ Á¦°¡ ¿øÇÏ´Â ÇüÅ·ΠÃâ·°À» ÇÏ´Â °ÍÀÔ´Ï´Ù.. : :°£´ÜÇÏ°Ô ÀÌ·¸°Ô »ý±ä ·êÀÌ ÀÖ½À´Ï´Ù.. :rule Test :{ : when : { : ?userObj: customer(AGE.longValue() < 20; : MOrder(\"9\").equals(\"Pro123\")); : } : then : { : execute : { : ?userObj.setmessage(?userObj.NAME + \" ´Ô.~~~~~\"); : } : } :}; : :ÀÌ ·êÀ» parsing ÇØ¼ Á¦°¡ ¿øÇÏ´Â ÇüÅ´ :Á¶°Ç : (³ªÀÌ < 20) ±×¸®°í (9¿ù ±¸¸Å»óǰ¾ÆÀ̵ð = Pro123) :°á°ú : ³²ÀÎÀç´Ô ~~~~~ : :¸ð ÀÌ·¸°Ô ³ª¿À°Ô ÇÏ·Á´Â °ÍÀÌ ÃÖÁ¾ ¸ñÇ¥ÀÔ´Ï´Ù. :¹°·Ð, Age°¡ \''³ªÀÌ\'' À̰í, MOrder°¡ \''¿ù ±¸¸Å»óǰ¾ÆÀ̵ð\''¶ó´Â °ÍÀº xml·Î ¾îµò°¡ Á¤ÀÇ µÇ¾î ÀÖÀ¸¹Ç·Î Method ¸íÀ̳ª attribute À̸§À» ³Ñ±â¸é °¡Á®¿Ã¼ö ÀÖ´Â moduleÀº ÀÖ±¸¿ä... : : :±×·³~ ÀÌÁ¦ Áú¹® µé¾î°©´Ï´Ù.. : :AGE.longValue() < 20 À̰æ¿ì¿¡´Â conditionÀÇ class°¡ IlrBinaryTest ·ç ÇØ¼ Á¦°¡ ¿øÇÏ´Â ´ë·Î °¡Á® ¿À´Âµ¥¿ä.. : :MOrder(\"9\").equals(\"Pro123\")ÀÇ °æ¿ì ¿ì¼± IlrUnaryTest ·Î °¡¼.. :\''obj\''°¡ ÀÌ condition ÀÔ´Ï´Ù... : :IlrUnaryTest test = (IlrUnaryTest)obj; :if(test.getArgument() instanceof IlrMethodInvocation) { : IlrMethodInvocation arg = : (IlrMethodInvocation)test.getArgument(); : Object argObj = arg.getObject(); : String columnName = null; : if(argObj instanceof IlrMethodInvocation) { : IlrMethodInvocation arg_1 = : (IlrMethodInvocation)argObj; : Object argObj_1 = arg_1.getObject(); : String columnName_1 = null; : if(argObj_1 instanceof IlrObjectValue) { : // : // ¹®Á¦´Â ¿©±â.. : // IlrObjectValue¿¡¼ ¾î¶»°Ô method ÀÇ À̸§À̳ª : // argument Á¤º¸, ŸÀÔ : // return Á¤º¸, ŸÀÔ µî ÇÊ¿äÇÑ Á¤º¸¸¦ ²¨³»¿Ã¼ö ÀÖ³ª¿ä? : // : } : : : : : :Áú¹®ÀÌ ¾î¼ö¼±Çؼ~ Àü´ÞÀÌ Àß µÇ¾ú³ª ¸ð¸£°Ú³×¿ä~ :ÇÏÁö¸¸ ÀÌÇØÇϽø®¶ó ¹Ï°í~ ±×·³ ²À Á» ¾Ë·ÁÁÖ¼¼¿ä... : |
|
|
|