Settings Tab - EnterWorks_Process_Exchange_(EPX) - 11.0

EnterWorks Process Exchange (EPX)

Product type
Software
Portfolio
Verify
Product family
EnterWorks
Product
Precisely EnterWorks
Precisely EnterWorks > EnterWorks Process Exchange (EPX)
Precisely EnterWorks > EnterWorks
Version
11.0
Language
English
Product name
Precisely EnterWorks
Title
EnterWorks Process Exchange (EPX)
Copyright
2024
First publish date
2007
Last updated
2024-02-29
Published on
2024-02-29T08:35:54.993000

The Settings tab is used to define the Java code to be executed and what gets updated in the work item.

  1. Enter the name of the property in the EPX hash table that you want to create or replace. You must know the name of the key. In the example below, the key User.fullName is used to create a new hash table key. The Code text box allows you to type Java code to transform information that is contained in the process flow.
    Note: The key can be blank if you intend to return multiple hash table values. Instead of returning a string object, a hash table is returned. Each object in the hash table will have a work item property created where the name of the property is the Java BIC key plus the name of the hash table entry. If the Java BIC key is empty, the work item property name is just the name of the hash table entry.

    The properties in the work item are made available as variables that can be used in the Java code that is written. The names of the variables are the same as the property name with dots replaced with underscores. In Java, the dot has specific meaning so it cannot be part of the variable's name. The underscore, however, will be used to reference work item properties in the Java code. For example, the property User.fullName would be referenced as User_fullName in the code.

    Note: You must not have properties that are identical in name except for dots or underscores as doing so will make references to the variable in the Java code ambiguous.

    In the Code text box, you can enter the standard Java statements and expressions. Statements and expressions are all of the things that you code inside a Java method, for example, variable declarations and assignments, method calls, loops, conditionals, and math expressions. You can declare and use methods in the Universal Java BIC just as you would in a Java class. These methods may also have dynamic (loose) argument and return types. In the Universal Java BIC, you have the option of working with "loosely typed" variables. That is, you need not declare the types of variables that you use (both primitives and objects). The Universal Java BIC will still give you an error if you attempt to misuse the actual type of the variable.

    Note: The Java code must return either a String (using toString() method for non-String objects) or a Hashtable if multiple properties are being created or updated.
  2. The code used above uses first, middle, and last name keys and values and returns a new key and value to the hash table, for example, User.fullName. This example shows that you need to specify a hash table key, wherein the result is placed; and some code that returns a String, which is the result. For the sample code above, the hash table already contains these values: the Key contains User.firstName, User.middleName, and User.lastName and the Value contains Christopher, Michael, and Reigrut respectively.

    If the user's address needed to be set along with the full name, the key would be changed to User and the code would return a hash table containing the full name and address properties. Here is the code for this example with a Key User:

    Hashtable ht= new Hashtable();
    ht.put("fullName",User_firstName + " " + User_middleName + " " + 
    User_lastName); 
    ht.put("address.street","123 Main St."); 
    ht.put("address.city","Main Town"); 
    ht.put("address.state","Maine"); 
    ht.put("address.zipcode","01234"); 
    return ht; 

    This will result in the properties:

    User.fullName = "Chris Michael Reigrut"
    User.address.street = "123 Main St." 
    User.address.city = "Main Town" 
    User.address.state = "Maine" 
    User.address.zipcode = "01234" 

    If the key is left blank, the following properties would be created:

    fullName = "Chris Michael Reigrut"
    address.street = "123 Main St."
    address.city = "Main Town" 
    address.state = "Maine" 
    address.zipcode = "01234" 
  3. The Java BIC has the capability to access, add, and delete attachments. To attach files to your Java BIC, click the Browse File button and select the file. To add more attachments, click the Add Row button. Click the Delete Row button to delete the attachments.
  4. Save the data entered and proceed to another tab by clicking Apply. Clicking OK will also save the data entered and exit the Universal Java BIC editor. To cancel saving the data entered, click Cancel.
    Note: The best practice is to define a Hashtable object, populate it with any properties to be set in the work item, then return the object and keep the Key field blank.