*
Metamerge logo
Search

Advanced Search
*
*
*
* HOME DOCUMENTS & RESOURCES DOWNLOADS EARLY TECH ACCESS SUPPORT FAQ KNOWN ISSUES OLD VERSIONS
*

The Entry Object

The entry object is used by AssemblyLines and EventHandlers. The entry object is a Java object that holds attributes and properties. Attributes in turn contain any number of values. Properties contain a single value.

Methods

For a complete list of available methods, including parameters and return values, see here. This is some of the commonly used methods:

Function Description
addAttributeValue (name, value) Adds a value to attribute name. If there is no attribute called name then a new attribute is created.
clone ( entry ) Return a clone entry from entry
getAttribute (name) Return the attribute named name
getAttributeNames() Returns an array of attribute names in this object
getObject (name) An attribute may have more than one value. This function returns the first value as an object. Some values have a string representation and others dont. This function returns the value as is with no conversions.
getOp() Returns the operation code for this entry as a char.

g ---> Generic (e.g. not specified)
a ---> Add
m ---> Modify
d ---> Delete

getOperation() Returns the operation code for this entry as a string. This is useful when programming in JavaScript. Possible values are "generic", "add", "modify" and "delete".
getProperty (name) Return the value for property name
getString (name) An attribute may have more than one value. This function returns the first value as a string.
merge ( entry ) Merge values from entry into this object
removeAttribute (name) Removes attribute name from this object
removeAllAttributes() Removes all attributes from this object
setAttribute (name, value) Set the attribute value for name to value.  Note: Using null as value will remove the attribute (as will remeoveAttribute().  Clearing the attribute is done by getAttribute("attributeName").clear()
setOp ( code ) Sets the operation code for this object. See getOp().
setProperty (name, value) Set the property value
size() Returns the number of attributes in this entry object

Global Entry instances available in scripting:

  • conn - The local storage object in Connectors in an AssemblyLine. It only exists during the Attribute Mapping phase of the Connector's life. When a Connector reads in data, this information is stored in conn, and must be transferred to the work object. Otherwise data read will be gone when the Connector Attribute Mapping is done. Conversely, you have to transfer Attribute data from the work object to conn in order for the Connector to be able to update the data source.
  • work - The data container object of the AssemblyLine. It is therefore accessible in every Connector from the AssemblyLine.
  • event - The event object is the work Entry object when scripting inside EventHandlers, just like the conn object during Attribute Mapping.
  • current - Available only in Connectors in Update mode. Stores the Entry that the Connector read from the data source to determine whether this is an Add or Modify operation.
  • error - An Entry object available in Connector's Hooks - holds error status information. The error object holds the following Attributes:
  • status (java.lang.String) - "ok" if there is no exception thrown (in this case this is the only error's attribute); "fail" if an exception if thrown - then these attributes are also available:
  • exception (java.lang.Exception) - the java.lang.Exception (or some its successor class) object that is thrown
  • class (java.lang.String) - the name of the exception class (java.lang.Exception or some of its successors)
  • message (java.lang.String) - the exception's error message
  • operation (java.lang.String) - Connector's operation type ("addonly","update", etc.)
  • Connectorname (java.lang.String) - the name of the Connector whose Hook is being called

See Also

Attribute Object

 
*
  Metamerge Integrator version 4.5 ©Copyright Metamerge AS 2000-2002 Last edited 2002-04-30 contact us