Service Data Collector

◷ Reading Time: 3 minutes

Service Data Collector of FlexRule Server is capable of storing output data from the workbench test results.

To set/ update service data collector settings,

  1. Log into FlexRule Server Workbench
  2. Go to Execution Server --> Services
  3. Select Edit option of your service
  4. Go to Collector tab

A set of options is available to store the required output of the service.

Run Results

  • Status: Enable or disable the service data collector. If this is disabled, the collector will not store data
  • Include Exceptions: Store the exceptions
  • Exclude Output Parameters: Store parameters except for output parameters
  • Include Extra Parameters: Include the extra parameters defined under Extra Parameter

Adding Extra Parameter Expressions

Extra parameters are used to define expressions/ parameters that can be manipulated from the existing variables in the service.

For example, let’s consider the Car Insurance example which has the output called car with AutoPremium and BasePremium properties.

             name: "car",
                value: {
                    Model: "IX35",
                    Price: 0,
                    BasePremium: 400,
                    AutoPremium: 1450,
                    Style: "Sedan",
                    ModelYear: 2007,
                    HasRollBar: false,
                    Convertible: false,
                    Age: 0,
                    HasMedicalCoverage: false,
                    UninsuredMotoristCoverage: false,
                    OccupantInjuryCategory: "Moderate",
                    TheftCategory: "High",
                    Airbags: "Driver, FrontPassenger",
                    Made: "Hyundai"

There if we want to store the Total of AutoPremium and BasePremium, we can define the collector as below. So it will only collect those values.

Make sure to click “Add New” and then “Update”. Then the collector will be added.

In the database, if you have a look at the table ServiceCollectors, you will be able to see the added collector.

Then test run the service to test the collector.

You will see the extra outputs in the service results of the test run.

If you go to the table ServiceResults, you will see that the extra parameter we added which is Total is saved there.

Updated on October 27, 2023

Was this article helpful?

Related Articles