Skip to main content

Creating Your Own DPL Using AIQ's JavaScript

Creating your own DPL requires Java programming skills and a familiarity with the DPL interface definition. It involves a two-step process: first, you need to implement the DPL main class; second, you need to define a new DPL type for Appvance IQ.

REMEMBER: this is only one of the many ways of creating DPLs (simulated data, and can be used for Scripts, Scenarios and more) if you want to learn more about how to create DPLs and integrate them you can visit our LMS and watch this videos:

https://academy.appvance.ai/mod/resource/view.php?id=211

https://academy.appvance.ai/mod/resource/view.php?id=206


Also, if you are interested in reading external data (Excel, CSV and others)


https://academy.appvance.ai/mod/resource/view.php?id=206

The DPL Java class implements the standard DPL methods including getNextData, getDataByIndex, and more. It needs to implement the com.Appvance.tool.dpl.DataProduction interface. Here is an example:

import com.Appvance.tool.dpl.DataProduction;
public class SimpleDPL implements DataProduction {
public SimpleDPL() { }
public void setup(String data) {
System.out.println("This is a setup using data "+data);
}
public Object getData() { return null; }
public Object getRandomData() { return "RANDOM DATA"; }
public Object getNextData() { return "Simple data: getNextData"; }
public Object getDataByIndex(int index) {
return "Simple data: get data by index "+index;
}
public void tearDown() { }
}

Once you define and compile a custom DPL packaged into a .jar file, you should use the <DataSources> in a TScenario document to identify your new DPL type.


Last updated: February 17, 2023

If you have any feedback on this topic, please contact us at documentation@appvance.ai