Open topic with navigation

TIBCO Business Studio™ - BPM Edition 5.4.0

# Business Data Scripting Best Practice

This section contains some suggestions for Business Data scripting.

## Keep the Scripts Small

It is recommended that you keep scripts small. You can do this by breaking potentially large chunks of logic into separate scripts.

## Ensure Business Objects Are Valid Before Scripts Complete

Remember that the length, limits, and multiplicity are checked at the end of every script, so ensure that all the Out and In / Out fields for the task have valid values before the script task is completed.

## Check for Nulls

It is very important to check that fields and attributes are not null before attempting to get their values.

## Use Comments in Scripts

It is good practice to comment code to make it easier for others who follow you to understand what the scripts are doing.

## Use Constant First when Comparing a Constant with a Variable

Using:

    constant == variable

is safer than:

    variable == constant

If "=" is used instead of "==" by mistake, the former construction results in a syntax error.

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.