When no system data toolkit variable types or business
objects match your specifications, you can create custom variable
types called business objects.
About this task
You can create a custom business object in the designer by using a base business object or by
defining a new complex structure.
When you create a business object in a workflow automation, that object is available for all business processes and
services in the workflow
automation. If you want to share a custom business object acrossworkflow automation, create or store the custom object
in a toolkit. Then, create a dependency on that toolkit from the workflow automation that requires the variable.
Procedure
- Open the designer.
- In the library, beside Data click + and
select Business Object to create a business object. Alternately, you can
create a business object by clicking New when you create a
variable.
The New Business Object window
opens.
- In the Name field, type a name for the custom business object and
click Finish.
Remember: Names of business objects are case-sensitive.
- Under Behavior, you see definition types.
- Simple type
- Creates a new simple business object that is derived from one of Boolean, Date, Decimal,
Integer, Selection, String or Time. A simple type that is created with the business object editor
cannot be initialized before use with a business process or service unlike a complex type. If you do
initialize a simple type that uses the new keyword, then you receive a runtime error.
- Complex type
- Creates a new complex business object by specifying the parameters for the structure. Complex
structure types that contain primitive types must initialize the primitive types before use.
An example of initializing a primitive type before use is
tw.local.myListOfComplexTypes[0].name = "";
.
- Select a type from the Definition type list.
- If you selected Simple type, select the type of your business object
and specify a validation if you want. For example, you might want to limit the number of characters
for a String type.
Ad hoc activity runtime behavior affects some string properties. None
(unlimited in length) defaults to a maximum of 64 characters. You see a warning that states this
limit when you select this property. If your application requires a large string, use the Range
property and set a large maximum length. Fixed (always same length) becomes a maximum
length.
- If you selected Complex type, add the parameters and a description of
each one, if you want. You can also order the parameters.
- If the business object and its values must be accessible to other instances at run time,
select Shared Object.
- To perform validation checks, calculations, or access checks on the shared business
object during save handling, select Save service and specify the heritage
service or service flow to use as a save service.
- Click Save or Finish Editing.