51Degrees Pipeline Documentation  4.1Newer Version 4.4


This example takes the very simple flow element described in the simple flow element example, and adds a JavaScript property to use client side evidence.

Instead of using evidence which is already available, as the simple flow element example did, this example will send JavaScript to the a client to get the evidence.

Download Example

The source code used in this example is available here:


The flow element will need a dependency on the Pipeline core package

Select a tab to view language specific dependencies.


The element data being added to the flow data by this flow element is a star sign. So this should have its own 'getter' in its element data. The additional property containing the JavaScript to get the date of birth is also added using the appropriate type.

Select a tab to view language specific element data implementation.


The client-side JavaScript for this example will be fairly simple. It will create a popup asking the user to enter their date of birth. It will then store the date of birth in a cookie named 'date-of-birth' and reload the page with the new cookie present.

The JavaScript to do this looks like:

// Ask the user for their data of birth.
var dob = window.prompt('Enter your date of birth.','dd/mm/yyyy');
if (dob != null) {
// Store it in a cookie.
// Reload the page with the new cookie.

Flow Element

Now the actual flow element needs to be implemented. For this, the flow element's base class can be used which deals with most of the logic. The element properties, evidence keys and the processing are all that need implementing.

Select a tab to view language specific flow element implementation.


Now the flow element needs one final thing, an element builder to construct it. This only needs to provide the flow element with a logger and an element data factory - as this example has no extra configuration options.

Select a tab to view language specific element builder implementation.


As this example gathers its evidence using client-side JavaScript, it will need to be run in a web environment. Using a web integration will mean that the flow element can be added, and the client-side JavaScript automatically run.

Select a tab to view language specific usage.

Next Steps

The example for Custom On-premise Engine shows how you can extend the functionality of this flow element to use a data file rather than hard coded values.