Salome HOME
d8e6d1e7c3b09d58a53873c84eda8672bbf41ca1
[samples/datafiles.git] / Yacs / Schemas / sinline5.xml
1 <!--
2   Copyright (C) 2006-2015  CEA/DEN, EDF R&D
3
4   This library is free software; you can redistribute it and/or
5   modify it under the terms of the GNU Lesser General Public
6   License as published by the Free Software Foundation; either
7   version 2.1 of the License, or (at your option) any later version.
8
9   This library is distributed in the hope that it will be useful,
10   but WITHOUT ANY WARRANTY; without even the implied warranty of
11   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12   Lesser General Public License for more details.
13
14   You should have received a copy of the GNU Lesser General Public
15   License along with this library; if not, write to the Free Software
16   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
17
18   See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19
20 -->
21 <proc>
22     <!-- a for each loop with 3 branches with a service node corba -->
23     <!--types -->
24     <sequence name="strvec" content="string"/>
25
26     <!--containers -->
27     <container name="A"> </container>
28
29     <!--nodes -->
30     <inline name="node0" >
31       <script>
32         <code>p1=["chris%d" % i for i in range(10)]</code>
33       </script>
34       <outport name="p1" type="strvec"/>
35     </inline>
36
37     <foreach name="b1" nbranch="3" type="string" >
38       <sinline name="node2" >
39         <function name="f">
40           <code>import salome</code>
41           <code>salome.salome_init()</code>
42           <code>import PYHELLO_ORB</code>
43           <code>print(__container__from__YACS__)</code>
44           <code>machine,container=__container__from__YACS__.split('/')</code>
45           <code>param={}</code>
46           <code>param['hostname']=machine</code>
47           <code>param['container_name']=container</code>
48           <code>compo=salome.lcc.LoadComponent(param, "PYHELLO")</code>
49           <code>def f(p1):</code>
50           <code>  print(compo.makeBanner(p1))</code>
51           <code>  print(p1)</code>
52           <code>  return p1</code>
53         </function>
54         <load container="A"/>
55         <inport name="p1" type="string"/>
56         <outport name="p1" type="string"/>
57       </sinline>
58     </foreach>
59     <inline name="node1" >
60       <script>
61         <code>print(p1)</code>
62       </script>
63       <inport name="p1" type="strvec"/>
64     </inline>
65
66
67     <!--control -->
68     <control> <fromnode>node0</fromnode> <tonode>b1</tonode> </control>
69
70     <!--datalink -->
71     <datalink>
72       <fromnode>node0</fromnode><fromport>p1</fromport>
73       <tonode>b1</tonode> <toport>SmplsCollection</toport>
74     </datalink>
75     <datalink>
76       <fromnode>b1</fromnode><fromport>SmplPrt</fromport>
77       <tonode>b1.node2</tonode> <toport>p1</toport>
78     </datalink>
79     <datalink>
80       <fromnode>b1.node2</fromnode><fromport>p1</fromport>
81       <tonode>node1</tonode> <toport>p1</toport>
82     </datalink>
83
84
85 </proc>