Don't wary about asking basic questions... after all TDI is a
complicated system which one gets to know in the process of finding
answers to the basic questions one asks himself.
First of all let me give you some info of the system store structure.
In the system store database you usually have a table that contains
only two columns - a primary key varchar column and a blob column. The
first one is the column used to identify the content of the second
one. The second one contains a plain old Entry object serialized as
bytes.
Having said that, the question we need to ask in order to help you is:
Where do you want to put this number, the first column (use it as
identifier) or the second column (as an Attribute of the Entry
object)? In either ways you put the number in an attribute to the
entry you pass to the connector that works with the system store. If
that attribute is chosen to be key that identifies the entry (this is
specified in the connectors configuration) then that attribute's value
is written to the first column. Otherwise the number is kept in the
entry stored in the second column and another attribute is used as a
key.
Hope this helps.
Best Regards,
Kaloyan Kolev.
1. If you just want to store Entries (Work Entry) and make these
available for lookup on a single unique key, then use the
SystemStore Connector. It takes all Output Mapped Attributes
(i.e. the conn Entry which has received these) and writes it
to the structure that Kaloyan described. Note that you don't
have to know _how_ this is done, you just need to know that
you can read and write whole Entries easily to the SystemStore
with this dedicated Connector.
Note that a bug in the current versions (6.1.1 fp4) means that
you should always map an Attribute called "ID" which you
use for the unique key attribute. Otherwise Lookups fail.
2. If all you want to do is persist a value, then use the system
methods (lookup the class UserFunctions in the JavaDocs,
which you reach via Help > Low Level API in the TDI CE).
system.setPersistentObject( keyValue, objToPersist )
system.getPersistentObject( keyValue )
system.deletePersistentObject( keyValue )
Not that objToPersist must be serializable.
3. You can also use the System Properties functions to write
data into the User property table in the SystemStore.
system.setTDIProperty("System-Properties", keyValue,
strValueToSave)
system.getTDIProperty("System-Properties", keyValue)
4. If you just need to persist something in memory, you could also
write it to the Java properties structure of the JVM:
java.lang.System.getProperties().put( keyValue, objRefToPersist )
java.lang.System.getProperties().get( keyValue )
This is a technique I use to pass data to and from scripted
Connectors and Parsers, since all scripted component (not SCs)
live in their own script context. In other words, they do not
share the
environment (and variables) of the AL itself.
Hope this helps :)
-Eddie