# create

The operation is used to create a parallel test component at any point in a behavior description by any other (running) component.

- A component is created with its full set of ports and empty input queues;
- all component variables and timers are reset to their initial values (if any);
- the component itself is not started (the operation start is used to do this);
- the operation returns the unique component reference of the newly created instance.

The optional alive keyword can be used to establish an "alive" parallel test component.

Optionally, a name can be associated with the newly created component instance. Associated component names can be free-format character strings, which are not required to be unique.

The main difference between normal and alive parallel test components is that alive parallel test components can be started many times while normal parallel test components can only be started once. See also the start keyword!

Related keywords:

- component
- start
- alive
- running
- stop
- kill
- done
- killed

### [ module_identifier.] component_identifier.create [ ( component_name ) ] [ alive ];

- component_identifier is a reference to an already defined component type.

- It may be optionally preceded by a module_identifier referencing the module where the component is to be created. The module identifier and the component identifier are connected by a dot.

- The create keyword is used to create a parallel test component.

Example 1:

var CompType_CT vc_CompRef;
vc_CompRef := CompType_CT.create;

The first line declares a variable having the same type (CompType_CT) as the component to be created. The second line creates the component and stores its reference in the variable vc_CompRef.

Example 2:

var CompType_CT vc_AliveCompRef;
vc_AliveCompRef := CompType_CT.create alive;

The declared component reference (vc_AliveCompRef) will be used to store the reference of the newly created alive parallel test component.

Example 3:

var CompType_CT vc_AliveCompRef;
vc_AliveCompRef := CompType_CT.create("mycomp") alive;

The component instance will have the name "mycomp".

BNF definition of create