10 In the frames of one YACS GUI session, YACS module allows the user to operate with several study documents (one per desktop). Each study
11 may contain some schemas, but only one YACS engine instance exists per study.
17 The user can execute a schema in different modes. Each of these modes can be chosen from :ref:`yacs_menu` of the YACS GUI in schema run mode. They are
22 + **Without stop Mode** - execute a schema in a normal way,
26 + **Breakpoints Mode** - execution of a schema is paused on each breakpoint,
29 + **Step by step Mode** - execute a schema step-by-step (i.e. node by node).
35 It's worth mentioning that for breakpoints mode it is suitable to use nodes' check boxes in the schema Tree View for run mode in order
36 to set a breakpoint on a node.
38 **Stop on error** option from :ref:`execution_toolbar` or from YACS main menu :ref:`yacs_menu` finishes execution of a schema if any error occurs.
39 It's useful if a schema has some parallel chains of nodes which can be executed simultaneously, and the user wants to break execution process
40 of the whole schema if only one of chains raise an error.
44 In order to start/resume execution of a schema it is needed to choose **Start/Resume execution** item from YACS main menu :ref:`yacs_menu` or click
45 corresponding button on :ref:`execution_toolbar`. This same command resumes schemas' execution, if it was paused earlier.
47 .. _pause_abort_reset:
49 The user can pause execution of a schema with help of **Suspend execution** item from YACS main menu :ref:`yacs_menu` or corresponding button
50 on :ref:`execution_toolbar`. By analogy, **Abort execution** and **Restart execution** commands can be activated either from YACS
51 main menu or Execution toolbar. **Abort execution** command kills execution of a schema, and
52 **Restart execution** command restart execution after having reset nodes terminated with error to initial state.
54 In the frames of YACS GUI a preliminary step of checking schemas' validity before creating a schema run is performed. The user is
55 informed by the system about all problems detected by this operation.
59 .. image:: images/functionality_list_79.jpg
63 **An example result of checking schemas' validity before create a schema run**
66 If a preliminary check is successfully done, schema run is created and then the user can start its execution in the chosen mode. Schema run
67 is exported to an XML file and passed to YACS CORBA engine and executed there. YACS CORBA engine is also given a study ID.
69 For visual representation of execution state the following means are provided by YACS module.
74 + **State of a node** - each state has its own color code at any moment of the execution. During the execution the background color of
75 the nodes' status is changed according to its execution status. In the YACS module for SALOME this color code is predefined.
76 The user has the possibility to specify it in the user preferences (see :ref:`set_user_preferences` section).
79 + **Values of ports** are shown during the execution process either on ports inside Tree view or on nodes' property page.
82 More than that, schema Tree View in run mode shows information about the current execution state of the whole schema and the current
83 execution state of each node.
87 .. image:: images/functionality_list_80.jpg
91 **The state of run Tree View during schemas' execution**
94 The selection of object in the run Tree View activates Input Panel with schema or node property page depending on the type of selected object.
98 .. image:: images/functionality_list_81.jpg
103 **Schema property page in run mode**
108 .. image:: images/functionality_list_82.jpg
112 **Inline node property page in run mode**
115 The user can get a detailed information about errors (if any) occured during the execution process from list box on the schema run property page.
117 The user can get errors on one node by using the **Node Error Details** command from its context menu.
119 .. image:: images/functionality_list_82a.jpg
123 **Error Details in an Inline node (zero division error)**
125 The **Node Error Report** command from the context menu gives the same information plus the status of the node.
127 For SALOME nodes, the **Node Container Log** command shows the associated container log as the node is executed in a remote process (container).
129 Lastly, the **YACS container log** command from the schema context menu shows the log of the YACS server where the user can find information
130 to solve problems encountered during the execution.
132 .. image:: images/functionality_list_82b.jpg
136 **YACS container log**
138 .. _save_restore_execution_state:
140 Save/Restore execution state
141 ----------------------------
142 If the current study contains an executable schema and the schema is in paused or stopped state, the user can save the current execution
143 state of the schema for its further usage.
145 The user can save an execution state of the schema by choosing the **Save State** command from the YACS main menu :ref:`yacs_menu` or from
146 the :ref:`execution_toolbar`. As a result of this operation, the dialog box similar to the standard SALOME GUI "Save file" dialog box
147 is shown by YACS module. The user should select an XML file to save schemas execution state into and the current execution state of the
148 schema is saved into the selected XML file.
150 Here is an example of XML file structure storing the current state of schemas' execution.
155 <?xml version='1.0'?>
157 <node type='elementaryNode'>
162 <value><double>0.5</double></value>
165 <node type='elementaryNode'>
166 <name><b>init</b></name>
167 <state><b>DONE</b></state>
169 <node type='elementaryNode'>
170 <name><b>Legendre.loopIter.deuxIter.iter1</b></name>
171 <state><b>DONE</b></state>
174 <value><double>-0.4375</double></value>
178 <value><double>-0.289062</double></value>
182 <value><double>0.5</double></value>
186 <value><int>4</int></value>
189 <node type='elementaryNode'>
190 <name><b>Legendre.loopIter.deuxIter.iter2</b></name>
191 <state><b>TOACTIVATE</b></state>
194 <value><double>-0.289062</double></value>
198 <value><double>-0.4375</double></value>
202 <value><double>0.5</double></value>
206 <value><int>5</int></value>
210 <name><b>Legendre.loopIter.deuxIter</b></name>
211 <state><b>ACTIVATED</b></state>
213 <node type='forLoop'>
214 <name><b>Legendre.loopIter</b></name>
215 <state><b>ACTIVATED</b></state>
219 <node type='elementaryNode'>
220 <name><b>Legendre.iter_1</b></name>
221 <state><b>DONE</b></state>
224 <value><double>0.5</double></value>
227 <node type='elementaryNode'>
228 <name><b>Legendre.iter_0</b></name>
229 <state><b>DONE</b></state>
232 <name><b>Legendre</b></name>
233 <state><b>ACTIVATED</b></state>
236 <name><b>proc</b></name>
237 <state><b>ACTIVATED</b></state>
241 XML file contains states of all schema nodes and the state of the whole schema.
243 If during saving the execution state into the XML file, problems with access rights or free space on a disk drive occur, YACS module
244 cancels saving of the execution state and shows an error message.
246 To continue the execution later from saved state the user can restore execution state for the selected schema from an XML file with
247 help from the :ref:`execution_toolbar`.
249 By default the **Save State** and **Load execution state** commands are applicable to the active schema.
255 In GUI, shutdown must be explicitly requested by the user by using the context menu of the schema (**Shutdown Proc** entry).
257 .. image:: images/functionality_list_82c.jpg
260 The shutdown level can be changed in the schema property page with the shutdown level combobox.
262 .. image:: images/functionality_list_64a.jpg
265 .. _create_new_edition:
269 In the run mode YACS GUI for SALOME provides the user with the possibility to create a copy of executed schema in order to do some
270 modifications in it. This functionality is avalable with help of **Edit Again** command from YACS main menu :ref:`yacs_menu` in run mode of
271 a schema or from corresponding button on the :ref:`execution_toolbar` in the same mode.
273 In such a case the user can done any modifications in the edition copy of the current schema run and after some corrections create a
274 new run schema object corresponding to the modified version of the schema. It can be considered as a cyclic process of execution
275 and correction of a schema.