Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Each flow component extends a base component that provides access to the following resources:

...

<name> is the name of the input reference. Note that a reference is always a function. To get the actual result of this function, it must be executed. 

Example:

this.refProp = this.getInputReference("Property")();

...

A flow component that provides an output reference must provide this reference as a function so that it is possible to pass static or dynamic results. Example:

function handler(In) {
var self = this;
this.setOutputReference("Property", execRef);

function execRef() {
return self.property;
}
}

The actual reference is set by:

...

Invocations of input connectors of a flow component are guarded invocations. That is, exceptions thrown by a flow component are caught and sent to the flow's error stream, log file and to the app log. 

...

Example (init handler of flow component Property):

function handler() {
this.properties = this.props["properties"];
this.types = this.props["types"];
this.values = this.props["values"];
this.BOOLEAN = Java.type("java.lang.Boolean");
this.INTEGER = Java.type("java.lang.Integer");
this.LONG = Java.type("java.lang.Long");
this.DOUBLE = Java.type("java.lang.Double");
this.FLOAT = Java.type("java.lang.Float");

if (this.properties.length !== this.types.length || this.properties.length !== this.values.length)
throw "Invalid number of entries for types or values";

for (var i=0;i<this.types.length;i++) {
var t = this.types[i];
if (!(t === 'boolean' || t === 'string' || t === 'integer' || t === 'long' || t === 'double' || t === 'float'))
throw "Invalid property type: " + t;
}
}