jbossdemocentral / brms-loan-realtime-decision-server-demo

This JBoss BRMS demo project will provide you with an example of creating, deploying and leveraging a set of rules (decision table) in a Realtime Decision Server. You will be given examples of calling the rules as if using it from an application with the RestAPI that is exposed.
11 stars 18 forks source link

Array type field xmlrequest #16

Open Vijay2611 opened 7 years ago

Vijay2611 commented 7 years ago

How can I put array type field in xmlrequest? for example I want to post an array test=[1,2,3]. would you please tell me how can I do it?

DuncanDoyle commented 7 years ago

This is an example with XSTREAM as the X-KIE-ContentType. Here I'm passing an array of Strings with the name "test:

<batch-execution>
  <insert out-identifier="test" return-object="true" entry-point="DEFAULT">
    <string-array>
      <string>1</string>
      <string>2</string>
      <string>3</string>
    </string-array>
  </insert>
  <fire-all-rules/>
</batch-execution>

And this is an example with JAXB as X-KIE-ContentType

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<batch-execution>
    <insert out-identifier="test" return-object="true" entry-point="DEFAULT" disconnected="false">
        <object xsi:type="jaxbListWrapper" componentType="java.lang.String" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <type>ARRAY</type>
            <element xsi:type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema">1</element>
            <element xsi:type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema">2</element>
            <element xsi:type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema">3</element>
        </object>
    </insert>
    <fire-all-rules max="-1"/>
</batch-execution>