Name: cockpit/testsets/Dynamic Order.xml 
1:
<?xml version="1.0"?>
2:
<!--
3:
  Apache License, Version 2.0
4:
  
5:
  Copyright (c) 2013 Juergen Mangler
6:
  
7:
  Licensed under the Apache License, Version 2.0 (the "License");
8:
  you may not use this file except in compliance with the License.
9:
  You may obtain a copy of the License at
10:
  
11:
      http://www.apache.org/licenses/LICENSE-2.0
12:
  
13:
  Unless required by applicable law or agreed to in writing, software
14:
  distributed under the License is distributed on an "AS IS" BASIS,
15:
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16:
  See the License for the specific language governing permissions and
17:
  limitations under the License.
18:
-->
19:
 
20:
<testset>
21:
  <positions/>
22:
  <handlerwrapper>DefaultHandlerWrapper</handlerwrapper>
23:
  <dataelements>
24:
    <quantity>3</quantity>
25:
    <bolts>null</bolts>
26:
    <boards>[]</boards>
27:
    <specA>High Quality</specA>
28:
    <specB>X3 Certification</specB>
29:
    <costs>0</costs>
30:
  </dataelements>
31:
  <handlers>
32:
    <handler url="xmpp://[email protected]">
33:
      <events topic='properties/state'>change</events>
34:
      <events topic='properties/datalements'>change</events>
35:
      <events topic='properties/position'>change</events>
36:
      <events topic='running'>activity_calling,activity_failed,activity_manipulating,activity_done</events>
37:
    </handler>
38:
    <handler url="xmpp://[email protected]">
39:
      <events topic='properties/state'>change</events>
40:
      <events topic='properties/position'>change</events>
41:
      <events topic='running'>activity_calling,activity_failed,activity_manipulating,activity_done</events>
42:
    </handler>
43:
    <handler url="xmpp://[email protected]">
44:
      <events topic='simulating'>step</events>
45:
    </handler>
46:
  </handlers>
47:
  <endpoints>
48:
    <bolts>http://localhost/gateways/bolts.php</bolts>
49:
    <boards>http://localhost/gateways/board.php</boards>
50:
    <controlling>http://localhost/gateways/controlling.php</controlling>
51:
  </endpoints>
52:
  <description>
53:
    <description xmlns="http://cpee.org/ns/description/1.0">
54:
      <call id="a1" endpoint="bolts">
55:
        <parameters>
56:
          <label>Buy Bolts from a Partner</label>
57:
          <method>post</method>
58:
          <parameters>
59:
            <specA>data.specA</specA>
60:
            <specB>data.specB</specB>
61:
            <quantity>data.quantity</quantity>
62:
          </parameters>
63:
        </parameters>
64:
        <manipulate output="result">  data.bolts = result.value('id')
65:
    data.costs += result.value('costs').to_f
66:
    status.update 1, 'Bolts'</manipulate>
67:
      </call>
68:
      <parallel>
69:
        <loop pre_test="data.quantity > 0">
70:
          <parallel_branch pass="data.quantity" local="p">
71:
            <call id="a2" endpoint="boards">
72:
              <parameters>
73:
                <label>Buy Board from a Partner</label>
74:
                <method>post</method>
75:
                <parameters>
76:
                  <specB>data.specB</specB>
77:
                </parameters>
78:
              </parameters>
79:
              <manipulate output="result">        data.boards << result.value('id')
80:
          data.costs += result.value('costs').to_f</manipulate>
81:
            </call>
82:
          </parallel_branch>
83:
          <manipulate id="a3">      data.quantity -= 1</manipulate>  
84:
        </loop>  
85:
      </parallel>  
86:
      <choose>
87:
        <alternative condition="data.costs > 700">
88:
          <call id="a4" endpoint="controlling">
89:
            <parameters>
90:
              <method>post</method>
91:
              <parameters>
92:
                <costs>data.costs</costs>
93:
              </parameters>
94:
            </parameters>
95:
          </call>  
96:
        </alternative>
97:
        <otherwise/>
98:
      </choose>
99:
    </description>
100:
  </description>
101:
  <transformation>
102:
    <description type='copy'/>
103:
    <dataelements type='rest'/>
104:
    <endpoints type='rest'/>
105:
  </transformation>
106:
</testset>