The Executor for this component must obtain the values
of the “Shape” and “Material” properties and calculate the “Area,”
“Volume,” and “Weight” based on the dimension parameters provided.
For this simple Plate component there is no external application involved
and no need to make this component persistent. Therefore, you can implement
the execute method.
The basic sequence of steps for execution are:
Get all necessary property values, which are accessible from the RuntimeEnv
object passed in.
String theShape =
runEnv.getScalarProperty("Shape").getValueObj().getAsString();
String theMaterial =
runEnv.getScalarProperty("Material").getValueObj().getAsString(
);
Get the values of input parameters, which are contained in a separate
Context object available from the RuntimeEnv.
AggregateVariable dimensions = ((AggregateVariable)runEnv.getContext().
getParameter("Dimensions"));
ScalarVariable thicknessParm =
runEnv.getContext().getScalarParameter("Thickness");
Invoke any necessary applications or perform calculations internally (see
the full code example in Component Development Reference).
Set values of output parameters:
runEnv.getContext().getScalarParameter("Area").getValueObj().setValue(ar
ea);
runEnv.getContext().getScalarParameter("Volume").getValueObj().setValue(
volume);
runEnv.getContext().getScalarParameter("Weight").getValueObj().setValue(
weight);
The complete code for the Executor for this Plate component can be found
in Component Development Reference.