Wiki Markup |
---|
{scrollbar}
|
The
...
Action
...
Sequence
...
document
...
is
...
the
...
definition,
...
the
...
Runtime
...
Context
...
provides
...
an
...
execution
...
environment
...
and
...
the
...
Components
...
are
...
the
...
business
...
logic.
...
A
...
Component
...
performs
...
a
...
single
...
function,
...
a
...
group
...
of
...
related
...
functions
...
or
...
is
...
a
...
bridge
...
between
...
the
...
Pentaho
...
BI
...
Platform
...
and
...
an
...
external
...
application.
...
The
...
jFree
...
Reports
...
component
...
is
...
an
...
example
...
of
...
a
...
component
...
that
...
interfaces
...
the
...
platform
...
to
...
the
...
jFree
...
Reports
...
reporting
...
engine.
...
There are two major functions that a Component gets called to do - validate and execute. Validate is called to verify that the inputs are valid and all resources required to execute are available. Execute actually performs the action.
The action-definition node in the Action Sequence document defines how the component should function. It is the place to define and map inputs, outputs and any other metadata or settings the component will require when it is executed. The name of the component that executes the action definition is identified using the component-name node. The name is the name of a Java class that is dynamically loaded at runtime. When referring to the built in Pentaho components, the fully qualified name of the component should not be used, just the class name. For example, use EmailComponent instead of org.pentaho.plugin.email.EmailComponent.
...
Action-inputs
...
The
...
action-inputs
...
and
...
action-resources
...
define
...
the
...
parameters
...
that
...
will
...
be
...
passed
...
into
...
the
...
component
...
when
...
it
...
executes.
...
Some
...
components
...
have
...
required
...
inputs
...
that
...
must
...
be
...
available
...
or
...
runtime
...
error
...
will
...
occur.
...
Some
...
inputs
...
may
...
be
...
specified
...
but
...
are
...
optional.
...
For
...
example,
...
the
...
...
Component
...
requires
...
a
...
to
...
but
...
the
...
cc
...
is
...
optional.
...
There
...
are
...
several
...
ways
...
to
...
satisfy
...
a
...
required
...
input.
...
It
...
can
...
be
...
provided
...
as
...
a
...
passed
...
parameter
...
with
...
the
...
same
...
name
...
to
...
the
...
component.
...
It
...
can
...
be
...
mapped
...
to
...
a
...
different
...
name
...
and
...
passed
...
to
...
the
...
component.
...
It
...
can
...
be
...
hard
...
coded
...
with
...
a
...
constant
...
value
...
or
...
in
...
some
...
cases
...
it
...
could
...
be
...
prompted
...
for.
...
By
...
default
...
the
...
...
component
...
should
...
have
...
an
...
action
...
input
...
that
...
looks
...
like:
...
Code Block | ||||
---|---|---|---|---|
| ||||
<action-inputs>
<to type="string" />
. . .
</action-inputs>
{code}
h2. Action Input Mapping
What happens if a component requires an input named *x* and I want to pass it a suitable parameter named *y*? You can map any action-input to a different name using the *mapping* attribute. Again, using our trusty Email Component example, let's assume we have a JavaScript rule that performs a query and returns the email address for a user in an output-parameter named *EMAIL*. Let's further assume that I want to use that parameter as the *to* parameter in the Email Component. The XML fragment would look like:
{code:xml} |
Action Input Mapping
What happens if a component requires an input named x and I want to pass it a suitable parameter named y? You can map any action-input to a different name using the mapping attribute. Again, using our trusty Email Component example, let's assume we have a JavaScript rule that performs a query and returns the email address for a user in an output-parameter named EMAIL. Let's further assume that I want to use that parameter as the to parameter in the Email Component. The XML fragment would look like:
Code Block | ||||
---|---|---|---|---|
| ||||
<action-inputs>
<to type="string" mapping="EMAIL"/>
. . .
</action-inputs>
{code}
h2. Constant Values as Inputs
If a component requires an input parameter and it is not found in the |
Constant Values as Inputs
If a component requires an input parameter and it is not found in the action-inputs,
...
the
...
component
...
will
...
automatically
...
look
...
for
...
an
...
XML
...
node
...
with
...
the
...
same
...
name,
...
in
...
the
...
component-definition
...
section.
...
If
...
it
...
finds
...
one,
...
it
...
will
...
use
...
the
...
value
...
from
...
there.
...
The
...
XML
...
fragment
...
would
...
look
...
like:
...
Code Block | ||||
---|---|---|---|---|
| ||||
<action-inputs>
</action-inputs>
<component-definition>
<to>joe.pentaho@pentaho.org</to>
</component-definition>
{code}
h2. Replaceable Parameters
All components have the ability to use the built in template mechanism to perform text replacement using input parameters. This means that a constant value can be modified using the value of an action-input. Hmmm that wasn't very clear either. Let's try with an example:
{code:xml} |
Replaceable Parameters
All components have the ability to use the built in template mechanism to perform text replacement using input parameters. This means that a constant value can be modified using the value of an action-input. Hmmm that wasn't very clear either. Let's try with an example:
Code Block | ||||
---|---|---|---|---|
| ||||
<action-inputs>
<EMAIL type="string"/>
. . .
</action-inputs>
<component-definition>
<to>{EMAIL}@pentaho.org</to>
</component-definition>
{code}
|
The
...
text
...
within
...
the
...
curly
...
braces
...
{}
...
is
...
replaced
...
by
...
an
...
input
...
parameter
...
with
...
the
...
same
...
name.
...
In
...
this
...
example,
...
if
...
the
...
value
...
of
...
the
...
action-input
...
...
is
...
joe.pentaho
...
then
...
the
...
value
...
of
...
the
...
to
...
parameter
...
passed
...
to
...
the
...
...
component
...
would
...
be
...
joe.pentaho@pentaho.org
...
.
...
Note | ||||
---|---|---|---|---|
| =TODO}
| |||
|
Add
...
more
...
about
...
component-definition
...
and
...
action-outputs
...
Note |
---|
Wiki Markup |
---|
{scrollbar} |