Populating fields programmatically

In Unica Plan, you can create custom fields that are populated programmatically from the values in other fields.

To specify that you want a field to populate programmatically, you add an attribute with an attribute type of External Datasource to a form and specify a program to run. The program can be a web service (located anywhere) or a Java program that runs on the same server as Unica Plan.

For example, a field can call a program to generate a job number that is based on values that are entered in fields for business unit and product.

An attribute with the External Datasource attribute type appears in the user interface as a read-only data entry field paired with a Generate button. When a user clicks Generate, Unica Plan accesses the specified program and displays the result in the field.

To specify the program, you must include the <servicedetails> tag within the <column> tag. The <servicedetails> tag can contain the following tags.

Tag Description
type Enter either javaclass or webservice as the type.
classname Enter the server-side custom Java class in this tag. This custom class must implement the com.unicacorp.common.template.IdGenerate interface. If you specify a value in this tag, the <methodname> tag is optional.
param This tag has the following attributes.
  • parameter name
  • type
  • valuecolumn
You must define all parameters in the same map file, such as projectatts.product_id. You must specify the parameters in the order that the program expects them.
wsdl Enter the webservice definition file that is located on the Unica Plan server, or the URL to the file in this tag.
methodname Enter the webservice method name in this tag. If you specify the <classname> tag, this tag is not required.