Salome HOME
bos #29864 Irrelevant assert in test.
[modules/yacs.git] / doc / dataflow.rst
1
2 :tocdepth: 3
3
4 A standard dataflow
5 -------------------
6 Let's consider a YACS schema containing Block, FOR loop and inline script nodes with data ports.
7
8 The first step is to import the schema from YACS XML file. One of the ways for the user to do it is to click on the **Import schema** button 
9 on the :ref:`schema`. Let's open legendre7.xml from YACS_SRC/src/yacsloader/samples directory.
10
11 After import operation, click on the **Fit All** button of the 2D Viewer. We have the following state of SALOME application.
12
13
14 .. image:: images/functionality_list_98.jpg
15   :align: center
16
17
18 .. centered::
19   **The result of legendre7.xml import**
20
21
22 For more convenient view of a schema representation in 2D Viewer the user can arrange nodes and links with help of 
23 the **arrange nodes recursion** command of the **proc** node context menu.
24 The result will be the following.
25
26
27
28 .. image:: images/functionality_list_99.jpg
29   :align: center
30
31
32 .. centered::
33   **Representation of a schema after arrange nodes operation**
34
35
36 To change input value of the schemas' node it is needed to select this node either in schema 2D Viewer or in the Tree View of a schema. 
37 And after that change input ports values with help of corresponding controls on the property page of the selected node. 
38 But in our case, if we want to execute a body of the **loopiter** node 5 times we have to change the **nsteps** output port value of **init**
39 node from 3 to 5 with help of its property page (python editor), and press "Apply" button on the Input Panel schema 2D Viewer.
40
41
42 .. image:: images/functionality_list_100.jpg
43   :align: center
44
45
46 .. centered::
47   **Property page of init node**
48
49
50 In order to execute this schema the user should create a run of the schema with help of **New execution** button on 
51 the :ref:`execution_toolbar`. After a new schema run has been created, schema run Tree View is constructed and schema run object 
52 is published in the Object Browser.
53
54
55 .. image:: images/functionality_list_101a.jpg
56   :align: center
57
58 .. image:: images/functionality_list_101.jpg
59   :align: center
60
61
62 .. centered::
63   **Object Browser content and schema run Tree View**
64
65
66 If the user selects schema object in the Tree View, Input Panel with schema property page is presented. Errors raised during 
67 create execution process are shown in the list box of schema property page in the run mode. In our case there is 
68 no error.
69
70
71 .. image:: images/functionality_list_102.jpg
72   :align: center
73
74
75 .. centered::
76   **Schema property page in the run mode**
77
78
79 To use :ref:`breakpoints run mode <breakpoints_mode>` it is sufficient for the user to set breakpoints on nodes using check boxes 
80 in the run Tree View. Let's set one breakpoint - on **iter2** node inside **deuxIter** block.
81
82
83 .. image:: images/functionality_list_103.jpg
84   :align: center
85
86
87 .. centered::
88   **Set breakpoint in run Tree View**
89
90
91 Start execution with help of **Start/Resume** button on :ref:`execution_toolbar` in run mode. Execution is paused on the **iter2** node 
92 inside **deuxIter** block. The run Tree View displays states of nodes.
93
94
95 .. image:: images/functionality_list_104.jpg
96   :align: center
97
98
99 .. centered::
100   **Run Tree View of paused schema**
101
102
103 Now try to save execution state of the schema by clicking the **Save State** command in the YACS main menu or the **Save State** button in
104 the :ref:`execution_toolbar`. Save the current state of execution into /tmp/legendre7_exec_state.xml file.
105
106
107
108 .. image:: images/functionality_list_105.jpg
109   :align: center
110
111 .. centered::
112   **Save the current execution state of legendre7.xml schema**
113
114
115 Now execute the schema using **Start/Resume** button until the execution of the schema is finished, making sure that **loopiter** node 
116 had been executed 5 times.
117
118
119 .. image:: images/functionality_list_106.jpg
120   :align: center
121
122
123 .. centered::
124   **Execution of legendre7.xml schema is finished**
125
126
127 The user can check values of output ports with help of 'Output ports' table on the property page of a node.
128
129
130 .. image:: images/functionality_list_107.jpg
131   :align: center
132
133 .. centered::
134   **Output port values of iter_1 node**
135
136
137
138 Go back to edit mode and let's try to load saved execution state of legendre7.xml schema with the **Load previous state** button
139 in the :ref:`execution_toolbar`. After this operation run Tree View should be in the same state as at the moment of saving execution state.
140
141
142 .. image:: images/functionality_list_108.jpg
143   :align: center
144
145
146 .. centered::
147   **Run Tree View after load execution state**
148
149
150 Continue execution of the schema from the saved state and check values of output ports when execution is finished. They should be 
151 the same as obtained earlier during the first execution.
152