<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">Erhans,<br>
      <br>
      I think you've found yourself onto the wrong mailing list. This is
      for the development OF drools, not WITH Drools. Please ask your
      question on the USER mailing list. Also please make sure you
      thoroughly read the mailing list guide, especially the netiquette
      points 1 to 17.<br>
      <a class="moz-txt-link-freetext" href="http://www.jboss.org/drools/lists">http://www.jboss.org/drools/lists</a><br>
      <br>
      Mark<br>
      <br>
      On 31/07/2012 09:43, Erhans Triadi wrote:<br>
    </div>
    <blockquote
cite="mid:CAKHf7k+yTUX+uKrSVjT0PuJ1gQ+tVu9KOJuPE-5094N5NONrUQ@mail.gmail.com"
      type="cite">I use Drool Guvnor version 5.2.0.BRMS. I try to
      updating my Web decision table with Rest API from user guide <a
        moz-do-not-send="true"
href="http://docs.jboss.org/drools/release/5.3.0.Final/drools-guvnor-docs/html/ch09.html#d0e2735">http://docs.jboss.org/drools/release/5.3.0.Final/drools-guvnor-docs/html/ch09.html#d0e2735</a><br>
      <br>
      <u>This my source code:</u><br>
      <br>
      <i>package com.sample;<br>
        <br>
        import java.math.BigDecimal;<br>
        import java.util.ArrayList;<br>
        import java.util.List;<br>
        <br>
        import javax.ws.rs.core.Response;<br>
        <br>
        import org.apache.cxf.jaxrs.client.WebClient;<br>
        import
        org.drools.ide.common.client.modeldriven.dt52.DTCellValue52;<br>
        import
        org.drools.ide.common.client.modeldriven.dt52.GuidedDecisionTable52;<br>
        import org.drools.ide.common.server.util.GuidedDTXMLPersistence;<br>
        <br>
        public class Update {<br>
        &nbsp;&nbsp;&nbsp; public static void main(String args[]){<br>
        &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; WebClient client = WebClient.create("<a
          moz-do-not-send="true" href="http://127.0.0.1:8081/">http://127.0.0.1:8081/</a>");<br>
        &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; String authorizationHeader = "Basic " +
org.apache.cxf.common.util.Base64Utility.encode("admin:admin".getBytes());<br>
        &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; client.header("Authorization", authorizationHeader);<br>
        &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; String
content=client.path("jboss-brms/rest/packages/mortgages/assets/Pricing%20loans/source").accept("text/plain").get(String.class);<br>
        &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; //List&lt;DTCellValue52&gt; lData = new
        ArrayList&lt;DTCellValue52&gt;();<br>
        &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; List&lt;List&lt;DTCellValue52&gt;&gt; llData = new
        ArrayList&lt;List&lt;DTCellValue52&gt;&gt;();&nbsp;&nbsp;&nbsp; <br>
        &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; System.out.println(content);<br>
        &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; GuidedDecisionTable52 dt =
        GuidedDTXMLPersistence.getInstance().unmarshal(content);<br>
        &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; //llData = dt.getData();<br>
        &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; String oldContent =
        GuidedDTXMLPersistence.getInstance().marshal(dt);<br>
        &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; System.out.println("Original :
        \n============\n"+oldContent);<br>
        &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; llData = dt.getData();<br>
        &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; System.out.println("Numeric List idx-1 data-0 =
        "+llData.get(1).get(2).getNumericValue()); <br>
        &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <b style="color:rgb(0,0,153)">llData.get(1).get(2).setNumericValue(new
          BigDecimal(5000));</b><br>
        &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>
        <br>
        &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; dt.setData(llData);<br>
        &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; String newContent =
        GuidedDTXMLPersistence.getInstance().marshal(dt);<br>
        &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; System.out.println("Become :
        \n============\n"+newContent);<br>
        &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>
        &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; WebClient client2 = WebClient.create("<a
          moz-do-not-send="true" href="http://127.0.0.1:8081/">http://127.0.0.1:8081/</a>");<br>
        &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; client2.header("Authorization", authorizationHeader);<br>
        &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Response response= &nbsp;&nbsp;&nbsp;
client2.path("jboss-brms/rest/packages/mortgages/assets/Pricing%20loans/source").accept("text/xml").put(newContent);<br>
        &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; System.out.println("succeed");<br>
        &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; System.out.println(response.getMetadata());<br>
        &nbsp;&nbsp;&nbsp; }<br>
        }</i><br>
      <br>
      <br>
      I just try to set new value with 5000.<br>
      This code doesn't retrieve error, but the result is not true. My
      "Pricing loan" asset still not updated with new set value.<br>
      <br>
      Anyone can help? <br clear="all">
      <br>
      <br>
      <br>
      Best Regards.<br>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
rules-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:rules-dev@lists.jboss.org">rules-dev@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/rules-dev">https://lists.jboss.org/mailman/listinfo/rules-dev</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>