ScriptUtil

The bpm.scriptUtil provides methods to copy business objects. The following are the bpm.scriptUtil methods:

  • JSON to BOM

    The parseData() method parses the given JSON string and constructs an instance of the specified BOM Class type and returns an object of that type.

    bpm.scriptUtil.parseData(jsonString, fullyQualifiedBOMClassName);
  • BOM to JSON

    The stringify() method returns the JSON stringrepresentation of the given object, such as a BOM Class.

    bpm.scriptUtil.stringify(value);

DateTimeUtil

The DateTimeUtil function is used to wrap a TIBCO Business Studio - BPM Edition 4.x project DateTime into DateTime in UTC.

bpm.dateTimeUtil.convertDateTimeToDateTimeTZ(date);
bpm.dateTimeUtil.convertDateTimeToDateTimeTZ(dateString);

addDuration() Method

The addDuration() returns a new date that is the result of adding the duration to the date passed in the argument.

bpm.dateTimeUtil.addDuration(date, iso8601duration);
bpm.dateTimeUtil.addDuration(date, isPositive, year, month, day, hour, minute, second, millisecond);

Example

  • data.targetDate = bpm.dateTimeUtil.addDuration(dateTime,true, 0,0,0,36,0,0,0);

    Calculates a datetime corresponding to 36 hours into the future.

  • data.targetDate = bpm.dateTimeUtil.addDuration(dateTime, “PT2H”);

    Adds 2 hours onto a Datetime.