Process

Afecs allows to attach a process to a control system component. These processes can be scheduled to be executed before or after desired state of the control system state machine. 

Here is an example of U0 component description, where we define a process called user_predownloaded :



1  <rdf:Description rdf:about="http://COOLHOME/Component/USER/U0#U0">

3    <cool:hasName>U0</cool:hasName>
4    <cool:hasType>USER</cool:hasType>
5    <cool:hasPriority>88</cool:hasPriority>
6    <cool:isCodaComponent>true</cool:isCodaComponent>
7
8    <cool:include rdf:resource="http://COOLHOME/Process/USER/User_processes.rdf"/>
9    <cool:hasProcess rdf:resource="http://COOLHOME/Process/USER/user_predownloaded#User_predownloaded"/>
10
11 </rdf:Description>



Line 8 and 9 defines a process, which is described in the $COOL_HOME/Process/USER/User_processes.rdf file.

This file contains a description of the user_predownloaded process as:



1  <rdf:Description rdf:about="http://COOLHOME/Process/USER/user_predownloaded#User_predownloaded">

2     <cool:hasName>User_predownloaded</cool:hasName>

3     <cool:before>downloaded</cool:before>

4     <cool:runs rdf:resource ="#User_predownloaded_script"/>

5  </rdf:Description>

6

7  <cool:Script rdf:ID="User_predownloaded_script">

8     <cool:hasName>User_predownloaded_script</cool:hasName>

9     <cool:hasCommandString>emacs</cool:hasCommandString>

10   <cool:isSynchronous>true</cool:isSynchronous>

11   <!--<cool:hasTimeout>7</cool:hasTimeout>-->

12 </cool:Script>



If you can see line 3 tells us that this process is going to be executed before downloaded state of the CODA FSM. According to line 4 this process will run a script defined in the lines 7-12. Line 9 defines a command string to be executed in the component representing agent's shell, and line 10 declares this shell execution as synchronous. This means that before U0 component transitions to downloaded state an emacs editor will pop up and control system will wait until emacs will be closed.