Object relations
Chkexist( "[db=<FolderObject>] <SQLWhereClause>")
Checks the existence of an object using a relational identifier.
Parameters
<FolderObject>
Selection which is to be checked. Here, the following parameters can be given: "[db=<FolderObject>] <SQL-WhereClause>" <FolderObject> and <SQLWhereClause> can contain expressions, which are substituted for the current object. If the db parameter is not used, the current folder is used.
Return value
TRUE: if <SQLWhereClause> finds at least 1 object.
FALSE: if <SQLWhereClause> finds no objects.
chkref ( "[db=FolderObject>] <SQLWhereClause>", "<ConditionTrue>",
"<ConditionFalse>" )
Checks whether an object can be found using a relational identifier. Further conditions can be returned for the results TRUE and FALSE.
Parameters
<FolderObject>
Selection which is to be checked. Here, the following parameters can be given:
"[db=<FolderObject>] <SQLWhereClause>"
<FolderObject> and <SQLWhereClause> can contain expressions, which are substituted for the current ob-ject.
<ConditionTrue>
Condition expression which is to be checked for each object found. If FALSE is returned once for this condi-tion, chkref() is terminated with FALSE.
<ConditionFalse>
Condition expression which is to be checked for each object found. This check is only run if the selection from
<ConditionTrue> does not return a hit.
Return value
TRUE: if <ConditionTrue> returns TRUE for all objects.
FALSE: if at least one FALSE is returned for <ConditionTrue>.
Example
If ( chkref ("db=XREF_ELEMENT CHILD_AIMKEY=#PARENT_AIMKEY", "isPublicFolder", "FALSE") ) {
<Source code: TRUE is run >
} Else {
<Source code: FALSE is run >
} Note
NOTE: For performance reasons, chkexist should be used in cases where a simple existence check is being done. For i ! example: chkexist("db=Folder_All_Document AIMKEY>0") should be used instead of
ch-kref("db=Folder_All_Document AIMKEY>0","TRUE","FALSE")
Object relations 86
#( where [db=<FolderObject>] <SQLWhereClause> <Expression> )
This function returns an <Expression> for a specific <FolderObject> from the given object <SQLWhereClau-se>.
Parameters [db=<Folder-Object>]
If this parameter is defined, the <SQLWhereClause> is run in <FolderObject>. This can be a Folder object, an SQL table or an SQL view. If the parameter is not defined, the <SQLWhereClause> is run in the current context.
<SQL-Where-Clause>
The SQLWhereClause is the filter criterion for the Folder object. When searching for multiple objects, the first returned value is used. If multiple conditions are defined, the entire parameter must be placed in paren-theses ( ... ), quotation marks " ... ", or in single inverted commas ' ... '. If no object is found, an empty string ("") is returned.
<Expression>
Everything following the 2nd parameter in the <SQLWhereClause> is substituted for the object found as an expression.
Examples
Reading out the description of the current user from the user database:
#(where db=Folder_UserAdministration USERID='$(USERID)' #(LONG_DESC) )
Using nesting to determine the project leader (the person with the function Project Leader '
X_SHORT_DESC='ProjectLeader') of a project, and then from here the organization (with a defined mail address ' X_IS_MAIL_ADDRESS=1; field LONG_DESC):
#(where _
db=Folder_Xref_Parent_Person _
(X_CHILD_AIMKEY=#AIMKEY AND X_SHORT_DESC='ProjectLeader') _
#(where _
db=Folder_Xref_Child_Organisation _
(X_PARENT_AIMKEY=#AIMKEY AND X_IS_MAIL_ADDRESS=1) _
#(LONG_DESC) _ ) _
)
Another #where function is used here instead of giving a field name as the expression. This allows multi-layer branching from the hit. Note: As more than one 1 search criterion can be defined, SQLWhereClauses are placed in parentheses.
GetPersonAttribute ( "<Expression>" )
This function returns the substituted <Expression> for the linked person (marked as the recipient ->
X_IS_MAIL_ADDRESS=1).
GetOrganisationAttribute ( "<Expression>" )
This function returns the substituted <Expression> for the linked organization (marked as the recipient ->
X_IS_MAIL_ADDRESS=1)..
GetContactAddressAttribute ( "<Expression>" )
This function returns the substituted <Expression> for the linked address (marked as the recipient ->
X_IS_MAIL_ADDRESS=1).
GetAllPersonAttributes ( "<Expression>" , "<Separator>")
This function returns the substituted <Expression> for all the linked persons. The values are returned in one string separated by the character <Separator>.
GetAllOrganisationAttributes ( "<Expression>" , "<Separator>")
This function returns the substituted <Expression> for all the linked organizations. The values are returned in one string separated by the character <Separator>.
Object relations 87
#( GetHisAt <Pos> <Expression> )
This function returns the substituted <Expression> for all the history. <Pos> defines which history record is to be used. All the history records matching the current AIMKEY are found.
Parameters
<Pos>
0: <Expression> is returned as an empty string ("") 1: Substitution using the latest history record 2: Substitution using the latest history record +1 3: etc.
An empty string is returned if no history record can be found for the given <Pos>.
<Expression>
Expression which is to be substituted Example
Function returning the revision (field REVISION) and designation (field SHORT_DESC) for the latest his-tory record:
@(GetHisAt 1 #(REVISION) #(SHORT_DESC) )
#( GetHisTB <Pos> <MaxNum> <Expression> )
This function returns the substituted <Expression> for all the history. <Pos> defines which history record is to be used. All the history records matching the current AIMKEY are found. <MaxNum> can be used to define the area to be addressed by <Pos>.
Parameters
<Pos>
0: <Expression> is substituted for the current object
1: Substitution using the latest history record 1 (if <MaxNum> >= 1) 2: Substitution using the latest history record +1 (if <MaxNum> >= 2) 3: etc.
An empty string is returned if no history record can be found for the given <Pos>. Value must be
>= 1 and <= <MaxNum>
<MaxNum>
Maximum number of recent history records addressed by <Pos>
<Expression>
Expression which is to be substituted Note
If <MaxNum> is given for <Pos> = 0 or <Pos> , the <Expression> is substituted for the current object.i !
Example
Function always returns the version (field REVISION) and designation (field SHORT_DESC) for the 3 most recent history records:
@(GetHisTB 1 3 @(REVISION:t) @(SHORT_DESC:t) )
@(GetHisTB 3 3 @(REVISION:t) @(SHORT_DESC:t) )
@(GetHisTB 3 3 @(REVISION:t) @(SHORT_DESC:t) )
Object relations 88
#( LinkType <EntityType-Object> [:<Formatting>] )
Substitution for the list of all possible/permitted RelationshipIDs (link types) with which the current object and an object containing the specified EntityType object can be linked.
The parameters are expected as standalone objects separated by spaces. Round parentheses are obligatory. The formatting corresponds to the normal convention used for expressions.
Example
Link with a project (EntityType = AIM.PRO):
@(LinkType "AIM.DOC.ENG" )
Result −> AIM.XREF.DOC.PRO.ENG
#( NextPos <ParentAIMKEY> <Intervals> [<StartPos>] [<RelationshipID>] )
Returns the next item in the BOM.
Parameters
<ParentAIMKEY>
The ParentAIMKEY or an expression which can be substituted for the AIMKEY of the Parent object.
<Interval>
Defines the interval between two items in the bill of materials. This is not necessarily the incrementation. Ex-ample: If an interval of 10 items has been specified, and the current last item is 14, 20 is returned for the next item as opposed to 24. The next item in the series is therefore calculated instead of simply adding the incre-mentation.
[<StartPos>]
The start item used to calculate the next item. This parameter is optional. The start value is 1 unless defined otherwise. The specified start item is checked with the help of the parameter <Interval>, and then incremented if necessary to the next item matching the interval.
[<RelationshipID>]
A RelationshipID can be defined here. This parameter is optional. AIM.XREF.PART is used unless defined otherwise.
Example
Determining the next available item in the bill of materials:.
#(NextPos #AIMKEY $(Interval:-1) $(StartPos:-1) )
#( NewRevision <ParentAIMKEY> <Intervals> <Start> )
Returns the next revision. Synonymous with #(NextPos ...).
#( NextNumber <ParentAIMKEY> <Intervals> [<StartPos>] [<RelationshipID>] )
Returns the next item in the bill of materials. Synonymous with #(NextPos ...).
Status 89
Status
#( Status [: [icon|desc|id|onchange|onenter] ] )
Information is substituted for the current status. If no parameter is given, the parameter :desc is used.
Parameters :icon
Returns the icon file name and the extension for the current status :desc (:bez is still available for compatibility reasons)
Returns the status designation of the current status :id
Returns the status ID of the current status (corresponds to the field STATUSKEY) :onchange
Returns the attribute onChange of the current status (corresponds to the field STATUSKEY) :onenter
Returns the attribute onEnter of the current status (corresponds to the field STATUSKEY)
#( statusnext )
Returns all the currently available statuses (i.e. those which would be shown in the selection!). They are retur-ned in sequence in quotation marks and separated by spaces.
Example
Result: "00001" "00003" "00004"
-> the number is shown using #(statusnext:v0) -> the first status is shown using #(statusnext:v1), etc.
#( statusdesc: <StatusKey> )
Returns the description for the specified <StatusKey>.
Example
Description of the designation of the first available status:
#( statusdesc: #(statusnext:v1) )
#( StatusUID <UID> [<Parameter>] [:<Format>] )
Substitutes information about the status change identified with <UID>.
Parameters
<UID>
The UID is returned by calling #(StatusNextUID …). This is a unique identifier for a status change. It is only valid for as long as the current user is logged in. Other unique UIDs are used the next time the user logs in.
[<Parameter>]
This governs which value is to be returned. Id is used by default unless defined otherwise. The following <Pa-rameters> are defined:
• Id (default): Returns the status ID of the target status available using this UID.
• Desc: Returns the description of the status change.
• Icon: Returns the name of the icon file assigned to the target status available using this UID.
• Backward: 1 is returned if the attribute Backward has been defined as 1 or TRUE for the status change.
Otherwise 0 is returned.
• Forward: 0 is returned if the attribute Backward has been defined as 1 or TRUE for the status change. Other-wise 1 is returned.
[:<Formatting>]
The format is applied to the result.
Status 90
Examples
The <UID> here is 23 Determining the StatusKey:
#(StatusUID 23 id )
Result -> 00002
Determining the text for the status change:
#(StatusUID 23 desc )
Result -> Send document to be checked Determining the icon file (upper-case letters):
#(StatusUID 23 icon :A)
Result -> STA00002.ICO Determining Backward:
#(StatusUID 23 Backward )
Result -> 0
#( StatusNextUID [{backward|forward}] [:<Formatting>] )
Returns the <UID> of the status changes possible from the status of the current object.
Parameters Backward
If this parameter is defined with spaces as separators, only those changes where the attribute Backward has been defined with 1 or TRUE are listed.
Forward
If this parameter is defined with spaces as separators, only those changes where the attribute Backward has not been defined at all or not with 1 or TRUE are listed.
Note
If neither Backward nor Forward is defined, all the status changes are listed.i !
Example
Returning the UIDs with spaces as separators as a character string:
#(StatusNextUID :v0)
Result -> 5
#(StatusNextUID Forward :v0)
Result -> 3
#(StatusNextUID Backward :v0)
Result -> 2
Selections 91
#( ReplState [: [icon|desc|id] ] )
Information is substituted for the current replication status. If no parameter is given, the parameter :desc is used.
Parameters :icon
Returns the corresponding icon file name and the extension for the current replication status.
:desc
Returns the designation for the current replication status.
:id
Returns the ID for the current replication status.
Replication statuses
The following replication statuses (these are checked in the order given here) exist for the primary files (not for secondary files):
Selections
#( numsele )
Number of selected objects.
#( numdisp )
Number of displayed objects.
#( nummark )
Number of marked objects.
#( selectioninfo: <Selection>: <Expression> )
<Expression> is substituted for the first object in the <Selection> . (See: ___Selection.)
#( selection: <Selection> )
Number of objects in the specified selection.
ID Name Icon
0 Original #TxRepl400 Replstate0.ico
1 No replica #TxRepl401 Replstate1.ico
2 Current #TxRepl402 Replstate2.ico
3 Transfer active #TxRepl403 Replstate3.ico
4 Outdated #TxRepl404 Replstate4.ico
Applications 92
Applications
taskrunning ( "[EXE:]<Exe-Name>" )
Checks whether the defined WINDOWS application is active (shown in the Windows taskbar = TRUE). The name of the EXE file, without the path but with the extension, is given as the parameter (optionally, the key-word EXE: can be given before the file name).
Example
NotePad is running:
taskrunning ( "EXE:notepad.exe" )
Return value
TRUE: The defined application has been found in the Windows taskbar FALSE: The defined application has not been found in the Windows taskbar
taskrunning ( "DDE:<DDE-Server-Name>" )
Checks whether the defined WINDOWS application is already active (accessible via DDE = TRUE). The key-word DDE: followed by the corresponding DDE server name is given here.
Example
ACADLT is running:
taskrunning ( "DDE:AutoCADLT.DDE" )
Return value
TRUE: The defined DDE server of an application is accessible FALSE: The defined DDE server of an application is not accessible
taskrunning ( "TIT:<WindowTitle MainWindow>" )
An application with the specified dialog window title is searched for. Wildcards can be used in the text entered here.
Example
ACADLT is running:
taskrunning ( "TIT:Auto*LT" )
Return value
TRUE: An application with the specified title has been found FALSE: An application with the specified title has not been found
LastCreatedProcessRunning ()
Checks whether the last program to have been started from Productstream Professional using ShellExecute(..) is still running or if it has already been terminated.
Return value
TRUE: If the program is still running FALSE: If the program is no longer running Version 5.2.2.12
Files 93
LastCreatedProcessWait ( <TimeOut> )
Waits either until the last program to have been started from Productstream Professional using ShellExecute(..) is terminated or for the <TimeOut> depending upon which event takes place first.
Return value
TRUE: if the program is closed.
FALSE: if the TimeOut is expired; i.e. the program is still running.
<TimeOut> specified in milliseconds. If TimeOut is set to -1, the function infinitely waits for the end of the program.
Version 5.2.2.12
GetLicence ( "<ProductLicenseKey>" , "<ReservationPeriod>" )
Reserves a license and returns whether the reservation was successful. This function can be used in condition expressions. The default time is used if the reservation period is defined with the value <=0.
Return value
TRUE: License reservation successful FALSE: License reservation failed Example
Attempting to reserve a license for COMPASS 2000 pro 5.4.x:
If ( !GetLicence("@(GetLicence AIMPROF540)","-1") ) {
<Sourcecode:License reservation failed>
} Else {
<Sourcecode: License reservation successful>
}
See also "___GetLicense" function description.
Files
exist ( "<File>" )
Checks whether a file actually exists. The result is TRUE if the file <File> exists. The file information comprises the directory name, file name and the extension. Wildcards (*,?) may not be used.
xexist ( "<FileModel>" )
Checks whether a file actually exists. The result is TRUE if the file exists. The <FileModel> comprises the di-rectory name, file name and the extension. Wildcards (*,?) can be used in the file name and the extension.
compFileSize ( "<File1>" , "<File2>" )
Compares the size of two specified files. The return value is an integer value.
Return value
0: The two files are the same size 1: The two files are not the same size 2: <File1> does not exist
4: <File2> does not exist
8: The name of <File1> could not be determined (possibly empty) 16: The name of <File2> could not be determined (possibly empty) 32: <File1> could not be opened for reading
64: <File2> could not be opened for reading
Files 94
compFileDate ( "<File1>" , "<File2>" )
Compares the date of two specified files. The return value is an integer value.
(Return values ' see compFileSize)
compFileBin ( "<File1>" , "<File2>" )
Compares the binary contents of two specified files. The return value is an integer value.
(Return values ' see compFileSize)
#(= FileSize ( "<File>" ) )
Function for determining the file size. The return value is an integer value.
Return value
>0 File size
<0 Error
#(= FileDate ( "<File>" ) )
Function for determining the file date. This function returns the date on which the file was last modified. The time zone and summer/winter time are taken into account. The function UTCFile( file ) returns a date without any conversion. The return value is a string.
Return value
"YYYYMMDDhhmmss": File date
"": Error
FileReadAccess ( "<File>" )
Queries the read rights for the specified file.
Return value
TRUE: Read access is available FALSE: Read access is not available
FileWriteAccess ( "<File>" )
Queries the write rights for the specified file.
Return value
TRUE: Write access is available FALSE: Write access is not available