Please enable JavaScript to view this site.

QPR Knowledge Base 2023.1

  •      
  • Navigation: Developer's Guide > QPR API > The Object Model > QPR Modeling > PGModel Commands

    Find

    Scroll Prev Top Next More

    Revision history:

    Introduced in QPR 7.6.1

    Last changed in QPR 2023.1.0

     

    Returns a list of IDs of QPR Modeling Client model elements defined by search parameters. The Find command supports all PGModel element types which have IDs.

     

    Synopsis:

     

    PGModel.Find(Parameters, Criteria, SortBy, out ResultList)

     

    Parameters:

     

    Parameters: A semicolon-separated list of parameters for defining the search base. Supported keywords are:

    FINDSTRING = String containing text that is searched for. In the case this parameter is present, the KIND parameter is ignored.

    FINDSTRING_OPTIONS = Comma-separated list of options for FINDSTRING. The supported options are:

    oWholeWordsOnly: Search whole words only, i.e. words that contain FINDSTRING but are longer than that are not included

    oMatchCase: Perform a case sensitive search

    KIND = ELEMENTTYPES | ELEMENTS | INSTANCES. If this is omitted, the default value "" (all kinds of objects) is used. Note that in the case FINDSTRING is present, this parameter is ignored.

    INSTANCEONLEVEL =  Integer defining the ID of the diagram where the search is performed.

    IDS = Comma-separated list of element IDs. If this is omitted, the default value "" (all elements defined by the Kind parameter) is used.

    ELEMENTTYPES = Comma-separated list of element type names or IDs. If this is omitted, the default value "" (all element types) is used. Also predefined Meta type names can be used:

    oALLACTIVITIES: all activity types

    oALLDIAGRAMS: all diagrams (both sub-process and custom element type diagrams)

    oALLSUBPROCESSES: all sub-process type diagrams

    oALLELEMENTDIAGRAMS: all custom element type diagrams

    oALLFLOWS: all flow types

    oALLEXTERNALMODELS: all external model types

    oALLELEMENTS: all custom element types

    oALLINFORMATIONFLOWS: all information flow types

    oALLNONINFORMATIONFLOWS: all non-information flow types

    oALLINFORMATIONCONTAINERS: all information container types

    oALLPROCESSSTEPS: all process step types

    oALLCHECKPOINTS: all checkpoints

    oALLTEXTS: all texts

    oALLPICTURES: all pictures

    Criteria: Not supported at the moment. Use an empty string here.

    SortBy: Not supported at the moment. Use an empty string here.

    out ResultList: Variant for storing an array which contains the results of the find operation. The format of the array depends on whether FINDSTRING or KIND was used. In the case of FINDSTRING, the result is an array with three columns:

    oElementId, integer

    oElementName, string

    oFoundInFields, string

     

    With the KIND parameter ELEMENTTYPES or ELEMENTS, the resulting array has only the ElementId column. With the KIND parameter INSTANCES, the resulting array has the element FullId column in a string format "ElementId.InstanceId". If an element type does not have instances, as is the case with connector types and the Organization Item type, then the InstanceId is 0. Note that if an Organization Item is drawn multiple times on the same diagram, Find returns it only once.

     

    Required Rights:

     

    At least view rights to the model object.

     

    Return Values:

    Below are listed the return values that this function can return:

     

    RV_SUCCESS

    RV_APPLICATION_QUIT_CALLED

    RV_MODEL_NOT_OPEN

    RV_ACCESS_DENIED

    RV_NO_DATA_FOUND

    RV_UNKNOWN_ERROR

     

    Example Procedure:

     

    iRet = PGModel.Find("KIND=ELEMENTS;ELEMENTTYPES=ALLSUBPROCESSES", "", "", arrResults)