System Behavior: Data Sheet  

Accessing this behavior This behavior can be accessed by clicking the System Behavior icon () in the Implementation toolbar.
Describing this behavior This behavior is designed to:
  • Launch an executable file (.exe), a shell (.sh) or a .bat file.
  • Call a compiled CAA coded function thus enabling you to perform complex operations that cannot be performed using a script language.
Methodology You choose in which mode (Process or library) the behavior works. In library mode, the name of the function, which corresponds to the name of the CAA function to call will be required. In this mode, the Process Name input will be the library name. The library name does not need the extension (like .dll under Windows OS), the behavior being OS independent, it looks automatically for the library corresponding to the current Operating System.

The availability of the behavior inputs depends on the selected call type.

  • Process: The behavior remains the same as the V5R15 one. The only difference is that it is possible to specify in which mode the process will be run.
  • Library: The function name is required and the process name requires the name of the library to load. The behavior is in CannotOperate mode until the 2 mandatory inputs i.e. the library name and the function Name are valuated. So if the function is located in a file called MyLib.dll, the library name will be MyLib.
    The library need not be in the runtime view at build time. Since the behavior calls a library, the module containing the function has to be compiled.
EXAMPLE When working with the CAA function, make sure that this function has the following signature:
extern "C" HRESULT MyCAAFunction (CATIVariableManagement* iBehavior, CATIVariableManagement*iExtendedObject) (see script below.)
The inputs are those defined on the behavior. As the behavior is an argument of the function, the CATIVariableManagement interface will be used to retrieve the behavior inputs. Behavior outputs will be managed using the same interface.
Using this Behavior Interface

Name Name attributed to the behavior.
Comment Comment attributed to the behavior.
Process Call Type: Process Select this mode if you want to launch an executable.
Library Select this mode if you want to call a CAA function. Only the library name must be specified.
Synchronous If checked, the process is run synchronously with the behavior. The synchronous/asynchronous run only applies to Process call types. The behavior will wait for the launched process to end before continuing its operation. It means that CATIA will wait for the process execution.
If unchecked, the process is launched and the behavior continues its operation, independently from the launched process.
Note that this option is available in Process mode only.
Process: Enter the process path or the process name if the process is recognized by the operating system (like notepad for example) or if it is in the runtime view.
When working with a CAA function, the Process name corresponds to the library name.
  Function name: Enter the name of the CAA function to call. This input is mandatory when working with CAA functions.
  Source File: Enter the name of the file that will be used to generate the input data for the process.
If no path is indicated, the CATTemp variable will indicate the directory to use.
If no file is indicated, a temporary file name will be allocated by the behavior.
Note that this field is not available when selecting the Library mode. It is therefore grayed out.
  Result File:  Enter the name of the file that will be used to handle the result of the process. 
Note that this field is not available when selecting the Library mode. It is therefore grayed out.
Note that for portable applications, the process must be accessible in the run time view.
Using this behavior You want to perform advanced operations using C++.