Add Command

Adds a data object to it's parent data object. Prior before doing this it executes several validation operators including the validation for duplicates.

images/download/attachments/43417851/AddCommand_add.png

Operators

Type Identifier

Allows Combination

Allows Multiple

Generic Operator Identifier

EntityValidator

yes

yes

ppm.std.operator.entityValidator

Validates a single entity data object. Implementations should not validate the children of a data object by themself.
A modification of the data object is not allowed in this operator, since subsequent operators might rely on the original
value and the order of operators might not always be guaranteed

EntityParentChildValidator

yes

yes

ppm.std.operator.entityParentChildValidator

Validates the parent/child relationships. For example, this operator might validate if it is allowed to add a second price to an item, etc. So it usually validates the cardinality of children for a parent.

EntityDuplicateFinder

no

no

ppm.std.operator.entityDuplicateFinder

Finds any duplicate records before the data object is added to it's parent. Depending on the results of this operator either the EntityAdder or the EntityDuplicateResolver will be called.
The generic implementation uses LogicalKeyEvaluator instances to search for a duplicate in the parent object.

EntityAdder

no

no

ppm.std.operator.propertySetter

Adds the child to the parent by either settings it as value of the corresponding attribute (1:1 relationships), or by adding it to the corresponding list of the parent (1:n relationships)

EntityDuplicateResolver

no

no

ppm.std.operator.entityDuplicateResolver

Resolves the duplicates which have been found by the EntityDuplicateFinder. The generic implementation will create a corresponding command feedback which usually aborts the command execution.
Other implementations might override the duplicate or merge the values, etc.

EntityPostAdder

yes

yes

n/a

Executed after the child has been added to the parent. The post adder will be called after the EntityAdder and also
after the EntityDuplicateResolver - unless the command context has been canceled before. (Which the default implementation of the resolver does!)

Use Cases

The ImportCommand uses the AddCommand to add new child objects to their parent.

The desktop client calls this command when you click on the save button in a detail table view.