All Categories Class Hierarchy This Category Previous Next Indexes
ActionFlow Class CATVpmAFIndexQuery
CATVpmAFIndexQuery
public class CATVpmAFIndexQuery
Query Manager class and Query static services for Action Flow.
The Query Manager allows to build and execute the current query to retrieve actions
from the index in the database.
Constructor and Destructor Index
- o
CATVpmAFIndexQuery()
- Constructs an "Action Flow Query Manager".
- o
CATVpmAFIndexQuery(CATUnicodeString*)
- Constructs an "Action Flow Query Manager" from settings.
- o
~CATVpmAFIndexQuery()
-
Method Index
- o
AddPredicate(CATINEOVpmPredicate_var&)
- Adds a predicate to the current query (using logical AND).
- o
Clear()
- Resets the current query to null.
- o
CreateApplicabilityPredicate(int,CATUnicodeString&)
- Creates the predicate to "query actions applicable on".
- o
CreateContextPredicate(CATUnicodeString&)
- Creates the predicate to "query actions with context".
- o
CreateIdPredicate(int,CATUnicodeString&,int)
- Creates the predicate to "query actions with id".
- o
CreateOpenDatePredicate(int)
- Creates the predicate to "query actions open for more than xx days".
- o
CreatePeoplePredicate(int,CATUnicodeString&)
- Creates the predicate to "query actions owned/created by".
- o
CreatePredicate(CATUnicodeString&,CATVpmOperator,CATUnicodeString&,int)
- Creates a predicate to query action index.
- o
CreatePredicate(CATUnicodeString&,CATVpmOperator,CORBAAny&,int)
- Creates a predicate to query action index.
- o
CreatePrioPredicate(CATUnicodeString&)
- Creates the predicate to "query actions with priority greater or equal to xx".
- o
CreatePropEffPredicate(int,CATUnicodeString&)
- Creates the predicate to "query actions with proposed effectivity".
- o
CreateSimpleQueryPredicate(CATListOfCATUnicodeString&,CATUnicodeString&,CATUnicodeString&)
- Creates the predicate for a "simple query":
(attr1 oper val1) OR (attr2 oper val2) OR .
- o
CreateStatusPredicate(CATUnicodeString&,int)
- Creates the predicate to "query actions with status".
- o
CreateTypePredicate(CATUnicodeString&)
- Creates the predicate to "query actions with type".
- o
CreateWorkingEffPredicate(CATUnicodeString&,char)
- Creates the predicate to "query actions with working effectivity".
- o
DerefActionIndex(CATINEOVpmIndexedInstance_var&,CATINEOVpmAFAction_var&,int)
- Retrieves action handler by dereferencing index row.
- o
GetLastSuffix(int)
- Returns last suffix (from last generated action).
- o
GetNewNbr(long)
- Computes automatic unique number used to build action primary ids.
- o
GetPredicate()
- Returns the current query predicate.
- o
InitFromSettings(CATUnicodeString*)
- Sets the current query from settings.
- o
ModifyIndexRowForContext(CATINEOVpmIndexedInstance_var&,CATUnicodeString&,CATUnicodeString&,char)
- Modifies the "modif_context" attribute of an index row.
- o
QueryActionFromId(CATUnicodeString&)
- Queries and dereferences the action for a given primary id
- o
QueryActionFromId2(CATUnicodeString&)
- Queries and dereferences the action for a given secondary id
- o
Run()
- Executes current query.
- o
RunAffObjQuery(SEQUENCE(octet)&,CATVpmAFIndexQuery*)
- Executes a query using the current query of a Query Manager,
with an added predicate to filter on actions that reference
a given part as "affected object".
- o
Settings(char,CATUnicodeString*)
- Reads or writes the settings file.
Constructor and Destructor
o CATVpmAFIndexQuery
| public CATVpmAFIndexQuery( | ) |
-
Constructs an "Action Flow Query Manager".
Note: If a VPMActionQuery.settings file exists, the Query Manager
will read from it to build the current query.
o CATVpmAFIndexQuery
| public CATVpmAFIndexQuery( | const CATUnicodeString* | iSettings) |
-
Constructs an "Action Flow Query Manager" from settings.
The settings array is formatted as follows :
entries 0 to 9 : filter menu-selection parameters
- [0] :
- Type of relation with P&O in "query actions owned/created by person/organization"
- ="0" :
- owned by person
- ="1" :
- created by person
- ="2" :
- owned by organization
- ="3" :
- created by organization
- ="4" :
- owned by site
- [1] :
- "Priority rank" in "query actions with priority greater or equal to xx"
- [2] :
- "Number of days" in "query actions open for more than xx days"
- [3] :
- Status in "query actions with status"
- [4] :
- Type in "query actions with type"
- [5] :
- Id mode in "query actions with id"
- ="0" :
- primary id
- ="1" :
- secondary id
- [6] :
- working effectivity
- [7] :
- Applicability type in "query actions with applicability"
- ="0" :
- on date
- ="1" :
- before date
- ="2" :
- after date
- ="3" :
- on range
- ="4" :
- before range
- ="5" :
- after range
- ="6" :
- with option
- [8] :
- Context
- [9] :
- Proposed effectivity type
- ="0" :
- date
- ="1" :
- range
entries 10 to 19 : filter keyed-in parameters
- [10] :
- P&O id in "query actions owned/created by person/organization"
- [11] :
- unused
- [12] :
- unused
- [13] :
- unused
- [14] :
- unused
- [15] :
- Action id in "query actions with id" (numeric value only if primary id mode)
- [16] :
- Working effectivity/modification tag
- [17] :
- Applicability value ("numeric" for range, "yyyy-mm-dd" for date)
- [18] :
- Context value
- [19] :
- Proposed effectivity value ("numeric" for range, "yyyy-mm-dd" for date)
entry 20 : filter selection map (10 x ('0' or '1') characters)
- [0] :
- ='1' if "query actions owned/created by" selected
- [1] :
- ='1' if "query actions with priority" selected
- [2] :
- ='1' if "query actions open for more than" selected
- [3] :
- ='1' if "query actions with status" selected
- [4] :
- ='1' if "query actions with type" selected
- [5] :
- ='1' if "query actions with id" selected
- [6] :
- ='1' if "query actions with working effectivity" selected
- [7] :
- ='1' if "query actions with applicability" selected
- [8] :
- ='1' if "query actions with context" selected
- [9] :
- ='1' if "query actions with proposed effectivity" selected
- Parameters:
-
- iSettings
- pointer to the settings array (or NULL to construct an empty Query Manager)
o ~CATVpmAFIndexQuery
| public ~CATVpmAFIndexQuery( | ) |
-
Methods
o AddPredicate
| public void AddPredicate( | const CATINEOVpmPredicate_var& | iPredicate) |
-
Adds a predicate to the current query (using logical AND).
- Parameters:
-
- iPredicate
- Predicate handler to be added
o Clear
-
Resets the current query to null.
o CreateApplicabilityPredicate
| public static CATINEOVpmPredicate_var CreateApplicabilityPredicate( | int | iApplMode, |
| const CATUnicodeString& | iApplVal) |
-
Creates the predicate to "query actions applicable on".
- Parameters:
-
- iApplMode
-
- =0 :
- on date
- =1 :
- before date
- =2 :
- after date
- =3 :
- on range
- =4 :
- before range
- =5 :
- after range
- =6 :
- with option
- iApplVal
- applicability (<"numeric"> for range, "yyyy-mm-dd" for date)
- Returns:
- Handler for created predicate
o CreateContextPredicate
-
Creates the predicate to "query actions with context".
- Parameters:
-
- iCtxtVal
- context as configuration handler identifier
- Returns:
- Handler for created predicate
o CreateIdPredicate
-
Creates the predicate to "query actions with id".
- Parameters:
-
- iIdMode
- =1 for primary id, =2 for secondary id
- iId
- action identifier (contains number only for primary id mode)
- IsNot
- =1 to negate the predicate (actions which id is not xx)
- Returns:
- Handler for created predicate
o CreateOpenDatePredicate
-
Creates the predicate to "query actions open for more than xx days".
- Parameters:
-
- iNumberOfDays
- Minimum number of days actions have to be open for
- Returns:
- Handler for created predicate
o CreatePeoplePredicate
-
Creates the predicate to "query actions owned/created by".
- Parameters:
-
- iPeopleType
- Type of relation to P&O :
- =0 :
- owned by person
- =1 :
- created by person
- =2 :
- owned by organization
- =3 :
- created by organization
- iPeopleId
- P&O identifier
- Returns:
- Handler for created predicate
o CreatePredicate
-
Creates a predicate to query action index.
- Parameters:
-
- iAttrName
- Index attribute name (see VX0INDDM.express schema in VirtualIndexedFolder Category)
- iOperator
- Filter operator
- iValue
- Filter value (text)
- IsNot
- =1 to negate the operator, 0 otherwise
- Returns:
- Handler for created predicate
o CreatePredicate
-
Creates a predicate to query action index.
- Parameters:
-
- iAttrName
- Index attribute name (see VX0INDDM.express schema in VirtualIndexedFolder Category)
- iOperator
- Filter operator
- iBinValue
- Filter value (binary)
- IsNot
- =1 to negate the operator, 0 otherwise
- Returns:
- Handler for created predicate
o CreatePrioPredicate
-
Creates the predicate to "query actions with priority greater or equal to xx".
- Parameters:
-
- iMinimumPrioNumVal
- String containing the priority rank
- Returns:
- Handler for created predicate
o CreatePropEffPredicate
-
Creates the predicate to "query actions with proposed effectivity".
- Parameters:
-
- iEffType
-
- =0 :
- date
- =1 :
- range
- iEffVal
- effecitivity value (<"numeric"> for range, "yyyy-mm-dd" for date)
- Returns:
- Handler for created predicate
o CreateSimpleQueryPredicate
| public static CATINEOVpmPredicate_var CreateSimpleQueryPredicate( | const CATListOfCATUnicodeString& | iAttrList, |
| const CATUnicodeString& | iOperator, |
| const CATUnicodeString& | iOperand) |
-
Creates the predicate for a "simple query":
(attr1 oper val1) OR (attr2 oper val2) OR ... (attrN oper valN)
- Parameters:
-
- iAttrList
- List of attribute names that participate in the query
- iOperator
- operator to compare each attribute value: "LIKE", "WITH" or "="
- iOperand
- string to match each attribute value using the above operator
- Returns:
- Handler for created predicate
o CreateStatusPredicate
-
Creates the predicate to "query actions with status".
- Parameters:
-
- iStatusVal
- Status value
- IsNot
- =1 to negate the predicate (actions which status is not xx)
- Returns:
- Handler for created predicate
o CreateTypePredicate
-
Creates the predicate to "query actions with type".
- Parameters:
-
- iType
- action type
- Returns:
- Handler for created predicate
o CreateWorkingEffPredicate
| public static CATINEOVpmPredicate_var CreateWorkingEffPredicate( | const CATUnicodeString& | iWorkingEff, |
| char | iExactMatch | = 0 ) |
-
Creates the predicate to "query actions with working effectivity".
- Parameters:
-
- iWorkingEff
- working effectivity (or modification tag)
- iExactMatch
-
- =1
- to match exactly the value of the working effectivity
- =0
- to match working effectivities that contain iWorkingEff substring
- Returns:
- Handler for created predicate
o DerefActionIndex
| public static void DerefActionIndex( | const CATINEOVpmIndexedInstance_var& | iIdxRow, |
| CATINEOVpmAFAction_var& | oAction, |
| int | iReadFromDatabase | = 0 ) |
-
Retrieves action handler by dereferencing index row.
- Parameters:
-
- iIdxRow
- Index row (see Run method)
- oAction
- Action handler
- iReadFromDatabase
- if (iReadFromDatabase == 1) then the action must be read from the database and not from
the memory. If the action is already loaded in the memory, it throws an error.
o GetLastSuffix
| public static CATUnicodeString GetLastSuffix( | int | iActionNbr) |
-
Returns last suffix (from last generated action).
- Parameters:
-
- iActionNbr
- Action number
o GetNewNbr
| public static CATUnicodeString GetNewNbr( | long | iInitNbr | = 0) |
-
Computes automatic unique number used to build action primary ids.
- Parameters:
-
- iInitNbr
- Number of an existing action (to query actions with greater number)
- Returns:
- string containing number to build new action primary id
o GetPredicate
-
Returns the current query predicate.
o InitFromSettings
| public void InitFromSettings( | const CATUnicodeString* | iSettings) |
-
Sets the current query from settings.
- Parameters:
-
- iSettings
- pointer to the settings array (or NULL to read the settings from disk :
(cf @see CATVpmAFIndexQuery )
o ModifyIndexRowForContext
| public static void ModifyIndexRowForContext( | const CATINEOVpmIndexedInstance_var& | iIndexRow, |
| const CATUnicodeString& | iOldVal, |
| const CATUnicodeString& | iNewVal, |
| char | iDoCommmit | =1 ) |
-
Modifies the "modif_context" attribute of an index row.
Warning: if commit is done, there is a flagged desynchronisation between the index row and the action.
- Parameters:
-
- iIndexRow
- index row to be modified
- iOldVal
- context value to be modified
- iNewVal
- context value to replace with
- iDoCommmit
- =1 to commit the modification to the database (usually only in the last call)
o QueryActionFromId
-
Queries and dereferences the action for a given primary id
- Parameters:
-
- iId
- action primary id
- Returns:
- Handler for action (NULL_var if not found)
o QueryActionFromId2
-
Queries and dereferences the action for a given secondary id
- Parameters:
-
- iId
- action secondary id
- Returns:
- Handler for action (NULL_var if not found)
o Run
| public CATLISTV(CATINEOVpmIndexedInstance_var) Run( | ) |
-
Executes current query.
- Returns:
- List of index rows for actions found.
o RunAffObjQuery
| public static CATLISTV(CATINEOVpmIndexedInstance_var) RunAffObjQuery( | const SEQUENCE(octet)& | iObjId, |
| CATVpmAFIndexQuery* | ioQueryMgr) |
-
Executes a query using the current query of a Query Manager,
with an added predicate to filter on actions that reference
a given part as "affected object".
- Parameters:
-
- iFlowTypes
-
- [0] : =1 to filter on part referenced as input affected object, 0 otherwise
- [1] : =1 to filter on part referenced as output affected object, 0 otherwise
- [2] : =1 to filter on part referenced as product, 0 otherwise
- iObjId
- object (part/document) uuid
- ioQueryMgr
- initial Query Manager (will contain the same current query in final)
- Returns:
- List of index rows for actions found.
o Settings
| public static void Settings( | char | iIOMode, |
| CATUnicodeString* | ioValues) |
-
Reads or writes the settings file.
- Parameters:
-
- iIOMode
- =1 to write, =0 to read
- ioValues
- settings array
( @see CATVpmAFIndexQuery)
This object is included in the file: CATVpmAFIndexQuery.h
If needed, your Imakefile.mk should include the module: VX0AFSVI