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

Only works in conjunction with Deltas.

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".

Only works in conjunction with Deltas. "Generic" will returned when used outside a Delta context.

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.  If you use JavaScript, refer to Comparing Strings In JavaScript since it is not always obvious how to compare such strings.
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. See Attribute Mapping.
  • 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 is available in a Connector's Hooks, but only in the Hooks that have a name that ends with Fail. The error object holds error status information in 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 is 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.6 ©Copyright Metamerge AS 2000-2002 Last edited 2002-06-10 contact us