Put Command

Typically used to set values of single fields of a data object. But in contrast to only allow a simple set operation on a field, it also is able to navigate through the object model to find the correct data object on which to set a value. This operation is called put, of course it's far more complex.

Set Operation

The set operation applies a single value of a property to the data object it directly belongs to. No hierarchical navigation is performed. The property value is validated and applied with additional permission checks and custom operators to perform your own logic.

Operators

Type Identifier

Allows Combination

Allows Multiple

Generic Operator Identifier

EntityPermissionChecker

yes

yes

ppm.std.operator.entityPermissionChecker

Checks permissions on field or entity level. The generic implementation validates against the qualified field permissions (since object permissions are validated in the detail model and action rights in UI)

PropertyInitializer

no

yes

n/a

Initializes an item property for command usage. Typical usage is to manipulate/resolve the property value based on the actual item.
For example, the main supplier which has an artificial ID of -10 will be resolved by the actual main supplier of the item using this operator.
This operator should not modify the data object.

PropertyValidator

yes

yes

ppm.std.operator.propertyValidator

Validates a single item property. The generic default implementation validates for everything which is defined in the repository. Lengths, ranges, enumerations, lower- and upperbound etc.
Since multiple contributions on multiple levels might be available for the same property, implementors are not allowed to change the value of the item property during a validation.
Other validators would not be able to work correctly in case the value changes depending on the order of validators. If you need to modify the value, you can do this with the PropertyInitializer operator.

PropertyPreSetter

yes

yes

n/a

Called before an item property will be set. Modification of the property value or the data object are possible here.

PropertySetter

no

no

ppm.std.operator.propertySetter

Sets the value of an item property to the data object's corresponding attribute using generic eSet methods on the EMF data objects.

PropertyPostSetter

yes

yes

n/a

Called after an item property has been successfully set

EntityPostCreator

yes

yes

n/a

Is called after all properties have been set to the data object. Can be used to perform entity validations which need to have access to multiple property values.

Use Cases

Put Operation

The put operation first tries to navigate to the correct target data object inside of the hierarchy. For this it uses the EntityFinder operator, which itself will use LogicalKeyEvaluator implementations to find the correct records based on the logical keys of the entity types which are "on the way" down the hierarchy.

The PutCommand will validate input values automatically based on the generic settings of the repository. This included length checks for text fields as well as range checks for numeric or date fields. It checks if the value is part of an enumeration as well as if the value is mandatory or not. The mandatory field check will also be executed for field values which have not (yet) been applied by calling the put operation - unless this has been disabled when calling the PutCommand. This might be a problem in case you want to execute multiple put commands on the same data object since the first put operation will then return an error feedback indicating that the value of a mandatory field is missing (namely the value of the other mandatory fields). For these scenarios you need to disable this check in the PutCommand and execute the ValidateCommand after you're finished with the PutCommands, or disable it for all calls but the last one.

images/download/attachments/43417854/PutCommand.put.png

Operators

Type Identifier

Allows Combination

Allows Multiple

Generic Operator Identifier

EntityPermissionChecker

See Set Operation

PropertyInitializer

See Set Operation

PropertyValidator

See Set Operation

PropertyPreSetter

See Set Operation

PropertySetter

See Set Operation

PropertyPostSetter

See Set Operation

EntityPostCreator

See Set Operation

Use Cases