Item Table References: Difference between revisions

From Planimate Knowledge Base
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
<onlyinclude>Items can carry references to table in a model so it can be referenced anywhere in the model. '''An item table reference only allows reading of the table'''.</onlyinclude>
<onlyinclude>Items can carry references to table in a model so it can be referenced anywhere in the model. '''An item table reference only allows reading of the table'''.</onlyinclude>  


Item Table References enable an item to carry around a reference to a table in the model. They are useful when sending message items to remote locations where the table is either not in scope or determined by from where the item is coming from.


To use an item table reference, in the Item Edit menu, create a named table reference for the class, say called "test". From now on, when editing a routine with that item flow involved and you select a table, you will now have "<item> test" available, enabling use of the item's reference to supply the table as well as the original tables and <Dynamic>.
Item table references are created from the Item Class Edit context menu just like Item Attributes. Once created, they appear in item attribute lists displayed by the expression editor and within the table list of the attribute reference dialog - as long as the object being edited has flows for that item class using it.


Before a reference can be used to access a table, a table has to be associated with it. This is done using the regular routine "Set (=)" operation, eg:


Once they are created, any routine with that item flow involved will be able to select that item table reference as a table. Item table references appear in the table selection dropdown with "<item>" in front of them.
i.itemtablename[] = t.tablename[]


Before a reference can be used to access a table, a table has to be associated with it.
Then i.itemtablename[] ban be used as a regular table reference eg:
This is done using the routine "SET" operation as follows:


*make "Target" a TABLE attref with the item table reference you want to set up (eg: "&lt;item&gt; testtable")
i.itemtablename[3][2].
*make "Set To" a TABLE attref with the table you want to point TO


To actually use the reference, set up your cell/column/etc reference as usual but select the "<item> testtable" instead of a normal table.
An item table reference can be made "Null" so it points to nothing by using the Clear operation, this will then display as:


An item table reference can be made "Null" so it points to nothing by using the clear operation with the target being set to a TABLE reference naming the item table reference. This will not clear the table itself, just the item's reference to it.
i.itemtable[] = CLEAR


A item table reference only allows reading from the table. This prevents unstructured modelling.
In places where the original item table is in scope, an item table reference allows both reading and writing to the table. If the table is not in scope, it is read only. However a mechanism exists to grant write access to an out of scope table. This is achieved using the OutOfScopeWrite operation on the item table reference. This must be performed at a location where the table referenced is still in scope.


During a run, ctrl-clicking on an item shows any item table references and what they are pointing to.
During a run, ctrl-clicking on an item shows any item table references and what they are pointing to.


Column labels can be used with item table references. They will be looked up on the fly but cannot be browsed in the editor, you have to enter the name manually since the editor does not know which table an item table reference will be pointing to.
Column labels can be used with item table references. They will be looked up on the fly but cannot be browsed in the editor, you have to enter the name manually since the editor does not know which table an item table reference will be pointing to.  


Splitters with the "Transfer Item Attributes" option "on" will also transfer table references. The transfer is name matched and partial transfers are always allowed (the Allow Partial Transfers option is ignored for item table references).<br /><br />
Splitters with the "Transfer Item Attributes" option "on" will also transfer table references. The transfer is name matched and partial transfers are always allowed (the Allow Partial Transfers option is ignored for item table references).[[Category:Item]] [[Category:Object/Splitter]] [[Category:Table]]
----
 
 
 
 
<font size="2">idkbase note 137</font>
 
[[Category:Item]]
[[Category:Object/Splitter]]
[[Category:Table]]

Revision as of 20:00, 17 April 2010

Items can carry references to table in a model so it can be referenced anywhere in the model. An item table reference only allows reading of the table.

Item Table References enable an item to carry around a reference to a table in the model. They are useful when sending message items to remote locations where the table is either not in scope or determined by from where the item is coming from.

Item table references are created from the Item Class Edit context menu just like Item Attributes. Once created, they appear in item attribute lists displayed by the expression editor and within the table list of the attribute reference dialog - as long as the object being edited has flows for that item class using it.

Before a reference can be used to access a table, a table has to be associated with it. This is done using the regular routine "Set (=)" operation, eg:

i.itemtablename[] = t.tablename[]

Then i.itemtablename[] ban be used as a regular table reference eg:

i.itemtablename[3][2].

An item table reference can be made "Null" so it points to nothing by using the Clear operation, this will then display as:

i.itemtable[] = CLEAR

In places where the original item table is in scope, an item table reference allows both reading and writing to the table. If the table is not in scope, it is read only. However a mechanism exists to grant write access to an out of scope table. This is achieved using the OutOfScopeWrite operation on the item table reference. This must be performed at a location where the table referenced is still in scope.

During a run, ctrl-clicking on an item shows any item table references and what they are pointing to.

Column labels can be used with item table references. They will be looked up on the fly but cannot be browsed in the editor, you have to enter the name manually since the editor does not know which table an item table reference will be pointing to.

Splitters with the "Transfer Item Attributes" option "on" will also transfer table references. The transfer is name matched and partial transfers are always allowed (the Allow Partial Transfers option is ignored for item table references).