xpfConditionalDeleteInstances


 

FUNCTION xpfConditionalDeleteInstances(modelId          : GENERIC;
                                        instancesAggrId  : AGGREGATE OF GENERIC;
                                        condition        : STRING;
                                        options          : INTEGER)
                                        deletedInstances : INTEGER;
                

This function deletes "all instances in the given 'instancesAggrId' argument that matches the actual specified 'options, and the optional given 'condition' argument.   When no 'expression' is defined and no options is specified, the function will be similar to performing xpxDeleteInstance() on each element in the 'instancesAggrId' argument.    The function value is the "number of instances deleted in the operation".

Arguments


TypeNameComment
GENERICmodelIdOnly effective when the option XPXDELETE_ALL_MATCHING_INSTACNES_IN_MODEL is enabled.
AGGREGATE OF GENERICinstancesAggrIdMay be an 'EntityExtent.instances' aggregate or any other aggregate. This has no effect hen the option XPXDELETE_ALL_MATCHING_INSTACNES_IN_MODEL is enabled
STRINGconditionAn logical EDMexpressX expression that will be evaluated for all "specified" instances. Only those instances that pass the 'condition' and match the specified options, will be deleted.
INTEGERoptions 

Return Value


 

TypeNameComment
INTEGERdeletedInstancesNumber of deleted instances

Options


OptionComment
XPXDELETE_ALL_MATCHING_INSTACNES_IN_MODELAll instances in the specified model 'modelId' that matches the specified options and the optional 'condition', will be deleted.
XPXDELETE_INSTANCES_REFERENCING_NO_OTHER_INSTANCESOnly instances that do not use any other instances in any roles, will be deleted
XPXDELETE_INSTANCES_AND_REFERENCESUse the xpxDeleteInstanceAndReferences() instead of xpxDeleteInstance() method in the actual "delete instance" operation.

 

Example


<Missing Example>

 

See also

Filter by label

There are no items with the selected labels at this time.

  
Description:
This function deletes "all instances of the instance type(s) specified in 'instanceTypesAggrId' argument that matches the actual specified 'options, and the optional given 'condition' argument.
   The function value is the "number of instances deleted in the operation".
   The argument 'modelId' .
   The argument 'instanceTypesAggrId'
   The optional 'condition' argument
  
Signature:
FUNCTION xpfConditionalDeleteInstanceTypes(modelId             : GENERIC;
                                           instanceTypesAggrId : AGGREGATE OF GENERIC;
                                           condition           : STRING;
                                           options             : INTEGER)
                                           deletedInstances    : INTEGER; 
Arguments:

modelId

Specifies the actual EDMdataModel to operate on (delete instances from)

instanceTypesAggrId

Specifies the actual instance types (entityId) to operate on. This argument has no effect hen the option XPXDELETE_ALL_MATCHING_INSTACNES_IN_MODEL is enabled.

condition

 Is an logical EDMexpressX expression that will be evaluated for all "specified" instances. Only those instances that pass the 'condition' and match the specified options, will be deleted.

options

see below

deletedInstances

Number of deleted instance types

Options Description

XPXDELETE_ALL_MATCHING_INSTACNES_IN_MODEL

All instances in the specified model 'modelId' that matches the specified options and the optionl 'condition', will be deleted.

 XPXDELETE_INSTANCES_REFERENCING_NO_OTHER_INSTANCES

Only instances that does not use any other instances in any roles, will be deleted.

XPXDELETE_INSTANCES_AND_REFERENCES

Use the xpxDeleteInstanceAndReferences() instead of xpxDeleteInstance() method in the actual "delete instance" operation.

XPXSUBTYPES

All instances that are subtypes of any of the specified instance types in the 'instanceTypesAggrId' argument, will be included in the actual xpfConditionalDeleteInstanceTypes() operation.

 
EXAMPLE