Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Current »


Description:
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".
   
Signature:
FUNCTION xpfConditionalDeleteInstances(modelId          : GENERIC;
                                       instancesAggrId  : AGGREGATE OF GENERIC;
                                       condition        : STRING;
                                       options          : INTEGER)
                                       deletedInstances : INTEGER;
Arguments:

modelId

Only effective when the option XPXDELETE_ALL_MATCHING_INSTACNES_IN_MODEL is enabled.

instancesAggrId

May be an 'EntityExtent.instances' aggregate or any other aggregate. This has no effect hen the option XPXDELETE_ALL_MATCHING_INSTACNES_IN_MODEL is enabled

condition

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

Options for the function

deletedInstances

Number of deleted instances

Options Description

XPXDELETE_ALL_MATCHING_INSTACNES_IN_MODEL

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

XPXDELETE_INSTANCES_REFERENCING_NO_OTHER_INSTANCES

Only instances that do 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.

 
EXAMPLE
 
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
 

  • No labels