Español Español English English Français
The WebAbility® Network

The WebAbility®

Enter the Web Effect

Documentación WebAbility® Network [Página principal]
The engine flow super box: ( /Box/reference/Engine )

I. Box flow

A box flow is a definition of a number of boxes that are linked together with those rules:
- A flow is lineal, means there cannot be loops between the boxes
- A box output can only be linked with another box input.
- Linked inputs and ouputs must be compatibles in type of data (see table below).
- Unlinked inputs must be filled before running the flow.

You may use a same box many times in the same flow, however, every time you use the box, a new instance will be created.

II. Definition of a flow

2.1. XML definition

The XML have 2 blocks nested into the 'enginebox' tag:
'boxes': is the list of boxes we are going to use into the flow, with links to other boxes,
'outputs': is the list of outputs.
The id of the tag is the name of our flow.

The engine sets automatically all the needed inputs based on the flow definition, i.e. all the not linked inputs of the flow definition.

<?xml version="1.0" encoding="UTF-8" ?>
<enginebox id="product">



Each tag in the boxes is the name of the box, and contains the definition of this box.


<box>class of the box</box>

The origin can be:
inline: the data contains the value to pass to the box
inputs: the data contains the name of the value to pass to the box
caller: the data contains the method of the caller to call to get the value
function: the data contains the function to call to get the value
integrator: the data contains a new array of inputs. All the inputs will be passed as an array to the box
[name of another box]: the data contains the id of the output of this box



The outputs are a list of outputs of each boxes.


The boxid is the id of the box contained into the definition of boxes in the first block.
The outputid is the id of the output of this box.

2.2. Array definition

III. Using the engine

If you are going to use only one engine box into your code, you only need to create an instance with the flow definition, assign the inputs then run the flow.

Standalone code:

// create an engine
$flowdef = '/path/to/flow.xml';
$e = new engineBox($flowdef);

// assign all the inputs of your flow
$e->setInputData('id', 'value');

// run the flow

// get the outputs
$o = $e->getOutputData('id');

Engine encapsulated into an Object:

class flowrunner
function X()
// create an engine
$flowdef = '/path/to/flow.xml';
$e = new engineBox($flowdef, $this);

// assign all the inputs of your flow
$e->setInputData('id', 'value');

// run the flow

// get the outputs
$o = $e->getOutputData('id');

return $o;

function getParams($id)
// Some params into your flow call this method to get the value of any parameter
return "params value";


If you are going to use your engineBox into another flow, you should entend the engine to set the flow definition:

class myFlowBox extends engineBox
function __construct()

$macroengine = new engine('another/flow.xml');


The $macroengine flow will use myFlowBox as a simple box somewhere into the definition of all the boxes.

[Ver la página] [Modificar] [Archivos multimedia] [Bitácora de cambios] [Seguridad] [Borrar esta página] [Cambiar el ID] [Herramientas]

WebAbility®, © 2000-2012 Philippe Thomassigny - Algunos derechos reservados