<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>
public static void main(String args[]){<br>
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>
String authorizationHeader = "Basic " +
org.apache.cxf.common.util.Base64Utility.encode("admin:admin".getBytes());<br>
client.header("Authorization", authorizationHeader);<br>
String
content=client.path("jboss-brms/rest/packages/mortgages/assets/Pricing%20loans/source").accept("text/plain").get(String.class);<br>
//List<DTCellValue52> lData = new
ArrayList<DTCellValue52>();<br>
List<List<DTCellValue52>> llData = new
ArrayList<List<DTCellValue52>>(); <br>
System.out.println(content);<br>
GuidedDecisionTable52 dt =
GuidedDTXMLPersistence.getInstance().unmarshal(content);<br>
//llData = dt.getData();<br>
String oldContent =
GuidedDTXMLPersistence.getInstance().marshal(dt);<br>
System.out.println("Original :
\n============\n"+oldContent);<br>
llData = dt.getData();<br>
System.out.println("Numeric List idx-1 data-0 =
"+llData.get(1).get(2).getNumericValue()); <br>
<b style="color:rgb(0,0,153)">llData.get(1).get(2).setNumericValue(new
BigDecimal(5000));</b><br>
<br>
<br>
dt.setData(llData);<br>
String newContent =
GuidedDTXMLPersistence.getInstance().marshal(dt);<br>
System.out.println("Become :
\n============\n"+newContent);<br>
<br>
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>
client2.header("Authorization", authorizationHeader);<br>
Response response=
client2.path("jboss-brms/rest/packages/mortgages/assets/Pricing%20loans/source").accept("text/xml").put(newContent);<br>
System.out.println("succeed");<br>
System.out.println(response.getMetadata());<br>
}<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>