# alive

The alive operation can used to see whether a given parallel test component is alive or not. It works similarly to the running operation, the difference is when used for alive parallel test components.

Normal parallel test component is alive when it is running. `vc_ptc.alive` always returns the same value as `vc_ptc.running` if `vc_ptc` is a normal parallel test component.

Alive parallel test component is alive from the point of its first start until it is killed implicitely at MTC termination or explicitely using the kill operation.

- The operation does not block TTCN-3 program execution, i.e., it reflects the momentary state of the parallel test component and does not wait for its termination.
- When the all keyword is used with the operation, it will return true if all parallel test components started are executing their behavior.
- When the any keyword is used with the operation, it will return true if at least one parallel test component is executing its behavior.

Related keywords:

- alive
- all
- any
- component
- create
- done
- kill
- killed
- running
- stop

### component_reference.alive;

- The component_reference is one of the following:

  - a reference returned by the create operation to refer to a given parallel test component,
  - the keyword pair all component to check whether all parallel test components are still alive,

  - the keyword pair any component to check whether at least one parallel test component is still alive

- The alive keyword denotes that (a) component(s) should be checked.

Examples:

Example 1:

var boolean v_Tbana := vc_metro.alive;

The variable v_Tbana gets the value true if the component with the reference vc_metro is alive, i.e. one of the following conditions apply:

- vc_metro is a normal parallel test component executing a function; or
- vc_metro is an alive parallel test component that has been started al least once and not killed yet.

Example 1b:

var boolean v_Ubahn := all component.alive;

The variable v_Ubahn will true if all started parallel components are still alive.

BNF definition of component alive