Occurrence class

An instance of the Occurrence class represents a single item in a job's occurrence trail, and allows retrieving the occurrence's attributes. See job occurrence trail.

Getting occurrence attributes

getTimeStamp( ) : Date

Returns the moment in time when this occurrence happened. The class of the returned Date object is specific to the scripting environment in use.

getType( ) : String

Returns the occurrence type as a string (one of "Detected", "Produced", "Moved", "Duplicated", "Processed" or "Failed").

getModule( ) : String

Returns the module or type of flow element causing this occurrence (same as the module attribute in a log message).

getFlow( ) : String

Returns the name of the flow causing this occurrence.

getElement( ) : String

Returns the name of the flow element (as displayed in the canvas) causing this occurrence.

getOrigin( ) : String

Returns an indication of the origin of the job before it was injected in the flow by this occurrence. For example, a Submit point writes the absolute path of the original job (on the client machine) in this attribute. This attribute is meaningful only for ‘Produced' occurrence types. This function returns the empty string for other occurrence types.

getOutFolder( ) : String

Returns the name of the folder (as displayed in the canvas) that received the job as a result of this occurrence. This attribute is meaningful only for ‘Produced', ‘Moved', and ‘Processed' occurrence types. This function returns the empty string for other occurrence types.

Note:

This function returns the outelement attribute.

getConnectionType( ) : String

Returns the type of the connection that carried the job as a result of this occurrence, as one of the following strings: "Noop", "Move", "Filter", "Traffic-data", Traffic-log", "Traffic-datawithlog". This attribute is meaningful only for ‘Produced', ‘Moved', and ‘Processed' occurrence types. This function returns the empty string for other occurrence types.

getSuccessLevel( ) : Number

Returns the success level of the job when carried over a traffic-light connection, as an integer (success = 1, warning = 2, error = 3). This attribute is meaningful only if the job was actually carried over a traffic-light connection. If the getConnectionType() does not return a string that starts with "Traffic", getSuccessLevel() returns zero.

getBasicMessage( ) : String

Returns the basic message associated with this occurrence, without argument replacement or localization. The basic message is not intended for human consumption, but can be used in a script to discriminate between various causes of an error, for example (similar to an error code).

This attribute is meaningful only for ‘Failed' occurrence types. This function returns the empty string for other occurrence types.

Note:

Note: this function returns the operation attribute without further processing.

getLocalizedMessage( ) : String

Returns the message associated with this occurrence after argument replacement and localization. The localized message is intended for human consumption.

This attribute is meaningful only for ‘Failed' occurrence types. This function returns the empty string for other occurrence types.

Note:

This function returns the localized message derived from the operation attribute and the relevant message arguments using the algorithm used for log messages.