Open topic with navigation

TIBCO Business Studio™ - BPM Edition 5.4.0

# Factory Methods

In addition, TIBCO Business Studio - BPM Edition scripting supports the use of factory methods to create new Business Object Model objects.

You can call:

field=factory.BOM_name.createClass();

where:

- field is the name of the data field to be populated, and must correspond to a process field defined as an External Reference to class in the Business Object Model,
- BOM_name is the Business Object Model name, with any dots replaced by underscores (so com.example.BOM would become com_example_BOM),
  Note: Note that this is the Name of the model, not the Label.
- Class is the name of the Business Object Model Class object,

For example, assume that there is a Business Object Model called com.myorg.customermodel, and that it contains a Class called Customer. To use a script to create an instance of this Class in the field cust, you would call the corresponding factory method as follows:

    data.customer = factory.com_myorg_customermodel.createCustomer();

As noted above this only needs to be done if the cust field has not already been initialized. You could check to see whether it has been created before invoking this line of the script, for example:

    if (data.customer == null)
    {
    data.customer = factory.com_myorg_customermodel.createCustomer();
    }

The Business Object Model object needs to have been created before any attributes defined in the Business Object Model can be assigned.

Did you find this helpful?

Yes No
Great!
Thanks for taking the time to give us some feedback.
Sorry about that

Why wasn't this helpful? (check all that apply)

Could not find what I was looking for
Instructions confusing or unclear
Instructions did not work

Want to tell us more?

Please select at least one option or provide details about the issue!!

Error occurred while submitting feedback.

Error2 occurred while submitting feedback.

TIBCO Business Studio™ - BPM Edition

Copyright © 2015-2023. Cloud Software Group, Inc. All Rights Reserved.