4.4.4. Copy Rule

[Tip]Description

This rule copies a subtree of the current model space to another location.

[Important]Syntax
CopyRuleAST ::= copy ( CopyContentsAST ) ;

CopyContentsAST ::= ArithmeticTermAST , ArithmeticTermAST , VariableRefAST , CopySemanticsAST								

CopySemanticsAST ::= copy_boundary_edges | skip_boundary_edges

The first parameter (source entity) is the root of the sub-model to be copied, and the second parameter is the target container.

Both source entity and target container is an ASM term that evaluates to a model element constant referencing an entity.

[Note]Semantics

A reference to the root element of the newly created sub-model is stored in a variable.

The copy semantics defines whether to copy (copy_boundary_edges) or not to copy the edges (skip_boundary_edges) that are going to or coming from outside the sub-model under copy.

Remark.  Note that the terminology has changed compared to previous Viatra versions (copy_boundary_edges instead of keep_edges; skip_boundary_edges instead of drop_edges).

Defined In:  model manipulation rule

See Also:  move rule