JavaScript API for IBM Process Designer

Parameters in italics are optional.
Namespace Summary
tw.object The object namespace is used to initialize complex IBM BPM objects.
tw.local The local namespace containing all private, input and output variables.
tw.system The system namespace containing process and step constants.
tw.epv The epv namespace containing the EPVs attached to a process.
tw.env The environment namespace containing all environment variables.
Object Summary
IntegrationComponent This class provides access to IntegrationComponents via JavaScript.
Map This class is a simple Map (Associative Array) implementation for JavaScript.
Record TWObject can have a number of attributes and properties depending on its setup. They can all be accessed by doing object. or object[""].
Serializer Provides serialize/deserialize methods for IBM BPM variables.
TWAdhocStartingPoint Represent an adhoc starting point
TWChart Chart object for reporting. Can take a layout name as constructor to create a chart in a process. Normally exposed as chart variable in contexts where available.
TWDate Represents a date.
TWDocument Represents a document.
TWDocumentSearchTypes Constant values for possible document search types.
TWDocumentTypes Constant values for document types.
TWLogger Helper class allowing to log errors, warning and debugs to the 'tw-javascript.log'. This class is available as 'log' variable in all javascript fields in IBM BPM.
TWManagedFile Represents a managed file for a particular snapshot of a Process App/Toolkit.
TWManagedFileTypes Contains constants for managed file types.
TWModelNamespace the 'tw.system.model' object contains useful functions to get model objects.
TWObject TWObject can have a number of attributes and properties depending on its setup. They can all be accessed by doing object. or object[""].
TWParticipantGroup Contains useful methods to access the participant group.
TWProcess Represents a BPD.
TWProcessApp A Process App/Toolkit object.
TWProcessAppDefaults Contains the defaults for this version of the Process App/Toolkit.
TWProcessAppSnapshot A Process Application object.
TWProcessInstance Represents a process instance.
TWProcessInstanceStatuses Constants to represent statuses of TWProcessInstance.
TWReport From this object one can access aspects of the report definition.
TWReportFilter This object exists in Report Filter Layouts only. It is used to give access to runtime and author set values of a report filter.
TWRole Contains useful methods to access the Role.
TWSavedSearch Represents a saved search object.
TWScoreboard Represents a scoreboard object.
TWSearch Contains properties and methods for search.
TWSearchColumn Contains properties for search column.
TWSearchColumnMetaData Search column information for returning and querying against columns.
TWSearchColumnMetaDataValueTypes Value types of the search column metadata.
TWSearchColumnProcessColumns Contains constants for searchable column names of a Process.
TWSearchColumnProcessInstanceColumns Contains constants for searchable column names of a Process Instance.
TWSearchColumnTaskColumns Contains constants for searchable column names of a Task.
TWSearchColumnTypes Contains constants for search column types operations.
TWSearchCondition Contains properties for a search condition.
TWSearchConditionOperations Contains constants for search condition operations.
TWSearchMetaData Used to describe data that can be used to perform searches.
TWSearchOrdering Contains properties for search ordering.
TWSearchOrderingOrders Contains constants for search orders operations.
TWSearchOrganizeByTypes Contains constants for task organized by types.
TWSearchResultRow Search results row object.
TWSearchResults Search results object.
TWService Represents an executable service.
TWServiceTypes Constants to represent types of services.
TWTask Contains useful methods to access the Role.
TWTaskPriorities Contains constants for priority types.
TWTaskStatuses Contains constant values for possible statuses.
TWTimerInstance An instance of a timer waiting.
TWUser Contains useful methods to access the User.
TWUserLocalePreferences Holds information about a user's locale preferences.
XMLDocument Represents an XML Document.
XMLElement Represents an XML Element.
XMLNodeList Represents a list of XMLElements.

IntegrationComponent

This class provides access to IntegrationComponents via JavaScript.

Property Summary
TWObject resultArray This object contains all the results in a standard Structure object. The property is only available after execute() is called.
Method Summary
IntegrationComponent execute() Executes the integration component.
IntegrationComponent getByName(String name) Finds an Integration Component using its name. If no component can be found for the provided name an exception is thrown.

Map

This class is a simple Map (Associative Array) implementation for JavaScript.

Property Summary
TWObject resultArray This object contains all the results in a standard Structure object. The property is only available after execute() is called.
Method Summary
boolean containsKey(ANY key) Returns true if the key exists.
ANY get(ANY key) Returns the value in the map for a particular key.
ANY[] keyArray() Returns an array of all keys in the map.
ANY put(ANY key , ANY value) Adds a new entry into the map.
void remove(ANY key) Removes the key from the map.
int size() The number of items in this map.
ANY[] valueArray() Returns an array of all values in map.

Record

TWObject can have a number of attributes and properties depending on its setup. They can all be accessed by doing object. or object[""].

Property Summary
int arrayLength Deprecated. arr.arrayLength is deprecated. Use arr.listLength instead.
Returns the length of the list properties of this object.
#[] listAllSelected Returns an array of all of the selected items in this array. The items are returned ordered so that the most recently selected item is in position 0 and the least recently selected at the end.
Integer[] listAllSelectedIndices Returns an array of all of the selected indices of this array. The indices are returned ordered so that the most recently selected index is in position 0 and the least recently selected at the end.
int listLength Returns the length of the list properties of this object.
# listSelected Returns the most recently selected item in the array or undefined if there are no selected items.
Integer listSelectedIndex Returns the index of the most recently selected item in the array or -1 if there are no selected indices.
String[] propertyNames Returns the names of the properties defined in this object as an Array.
Method Summary
Array arrayToNativeArray() Deprecated. arrayToNativeArray is Deprecated. Use listToNativeArray instead.
Converts this TWObject array to a Native JavaScript Array object.
XMLElement describe() Returns an xml structure of the properties and structure associated with this object. This is very useful for debugging.
void insertIntoArray(int position , ANY object) Deprecated. use insertIntoList() instead.
Adds a value to the list in a particular position. The list will be resized to fit the objects.
void insertIntoList(int position , ANY object) Adds a value to the list in a particular position. The list will be resized to fit the objects.
void listAddSelected(int index) Adds an item from the list of selected items.
void listClearAllSelected() Removes all items from the selection list.
boolean listIsSelected(int index) Returns true if item index is selected, false if not.
void listRemoveSelected(int index) Removes an item from the list of selected items.
Array listToNativeArray() Converts this TWObject array to a Native JavaScript Array object.
void remove(String propertyName) Removes a property from this object.
void removeIndex(int listIndex) Removes a value from the list. The list will be resized to fit the remaining objects.
XMLElement toXML() Returns an xml structure of the properties associated with this object.
String toXMLString() Returns an xml structure as String of the properties associated with this object.

Serializer

Provides serialize/deserialize methods for IBM BPM variables.

Method Summary
ANY fromXml(TWObject variable) Deserialize a String or XMLElement object to a IBM BPM variable.
XMLElement toXml(TWObject variable) Serialize an object to XML.

TWAdhocStartingPoint

Represent an adhoc starting point

Property Summary
String id The id of the adhoc starting point.
String name The name of the adhoc starting point.
TWProcessInstance processInstance The process instance this adhoc starting point belongs to.
Method Summary
String[] startNew() Triggers an adhoc start event.

TWChart

Chart object for reporting. Can take a layout name as constructor to create a chart in a process. Normally exposed as chart variable in contexts where available.

Property Summary
Array bottomLabels list of labels set on this chart.
String chartType The chart type.
boolean hasBarSeries Returns true if this chart type takes bar series.
boolean hasDialSeries Returns true if this chart type takes dial series.
boolean hasLineSeries Returns true if this chart type takes line series.
boolean hasPieSeries Returns true if this chart type takes pie series.
boolean seriesCount Returns the number of series applied to this chart.
Method Summary
void addBottomLabels() (series)set the bottom labels.
void addSeries(int index , String name , String type , Object series) Adds a series to the chart. (index, name, type, series) : index - the index of this series (for ordering), name - the series name used in legends, type - type of series (bar,line,pie,dial), series - comma separated list, list, TWObject containing the data for this series.
String display(Integer width , Integer height , Boolean removeDemoData) (width, height)display the chart. Returns the HTML needed.
String displayCSVTable() Displays a comma separated table of the chart data.
String displayTable() Displays an HTML table of the chart data.
ANY[] getSeriesData() (series) get the data off a series.
String getTypeName() Returns the name of the type.
void setFeature(String feature , Object value) Sets or changes a feature of the chart. Supports the following features: axis Change the left axis of the chart. You can set it to auto with feature="auto", or set it to a fixed axis by using the string argument "fixed,,,". , and have to be numerical values defining the axis scope. title Changes the top title of the chart if it got one. The value should be the title text. leftLabel Changes the left label of the chart if it got one. The value should be the text of left label. bottomLabel Changes the bottom label of the chart if it got one. The value should be the text of bottom label. colorTable Changes the default color theme of the chart if used. The value is an array of color items understood according to the chart package used. The argument can either be an array or a comma separated string..
void setLayout(String layoutID) Updates chart's layout.
void setLayoutByName(String layoutName) Updates chart's layout through looking up current and underneath contexts.

TWDate

Represents a date.

Method Summary
String format() Format the date according to the default string format.
String format(String formatString , String timeZoneString) Format the date according to the formatString and timeZoneString provided. The formatString must follow the syntax and rules laid down for the java.text.SimpleDateFormat class. The timeZoneString must be a valid time zone identifier according to the rules in java.util.TimeZone.
String formatDate(String dateStyle) Converts a date to a string representation using specific format. The parameter 'dateStyle' can take the values: short, medium, long, full.
String formatDateTime(String dateStyle , String timeStyle) Converts this date and time to a string representation using specific formats. The parameters 'dateStyle' and 'timeStyle' can take the values: short, medium, long, full.
String formatTime(String timeStyle) Converts this time to a string representation using specific style.
int getDate() Returns the day of the month as an integer.
int getDay() Returns day of the week as integer where the first day is Sunday and equal to 1.
int getFullYear() Returns four-digit year as integer.
int getHours() Returns the hour within the day (24h).
int getMilliseconds() Returns the milliseconds within the seconds.
int getMinutes() Returns the minutes within the hour as an integer.
int getMonth() Returns month number as integer where January is the first month and equal to 0.
int getSeconds() Returns the seconds within the minute.
int getTimezoneOffset() Returns raw offset from GMT in minutes.
int getUTCDate() Returns the day of the month as an integer in Coordinated Universal Time (UTC).
int getUTCDay() Returns day of the week as integer where the first day is Sunday and equal to 1 in Coordinated Universal Time (UTC).
int getUTCFullYear() Returns four-digit year as Integer in Coordinated Universal Time (UTC).
int getUTCHours() Returns hour within day as Integer in Coordinated Universal Time (UTC).
int getUTCMilliseconds() Returns milliseconds within second as Integer in Coordinated Universal Time (UTC).
int getUTCMinutes() Returns minute within hour as Integer in Coordinated Universal Time (UTC).
int getUTCMonth() Returns month number as Integer where January is the first month and equal to 0 in Coordinated Universal Time (UTC).
int getUTCSeconds() Returns seconds within minute as Integer in Coordinated Universal Time (UTC).
void parse(String dateAsString , String formatString) Sets the value of the date by parsing dateAsString using the formatString provided. The formatString must follow the syntax and rules laid down for the java.text.SimpleDateFormat class.
void parse(String dateAsString , String formatString , String timeZoneString) Sets the value of the date by parsing dateAsString using the formatString and timeZoneString provided. The formatString must follow the syntax and rules laid down for the java.text.SimpleDateFormat class. The timeZoneString must be a valid time zone identifier according to the rules in java.util.TimeZone.
void setDate(int dayOfMonth) Sets day of the month to the number supplied in parameter(must be valid for month).
void setDay(int dayOfWeek) Sets day of week to integer supplied in day of week where Sunday is 1 and the first day of the week.
void setFullYear(int year) Sets the year to four-digit number in full year.
void setHours(int hours) Sets the hour on the 24 hour clock to the specified hour value. The Midnight hour is hour 0.
void setMilliseconds(int millis) Sets the milliseconds within the second to the value in milliseconds.
void setMinutes(int minutes) Sets the minutes within the hour.
void setMonth(int month) Sets the month to the number indicated in month number. January is the first month and is equal to 0. Number must be a valid month 0-11.
void setSeconds(int seconds) Sets the seconds within the minute to the value in seconds.
void setUTCDate(int dayOfMonth) Sets day of the month to the number supplied in day of month (must be valid for month) in Coordinated Universal Time (UTC).
void setUTCDay(int dayOfWeek) Sets day of week to integer supplied in day of week where Sunday is 1 and the first day of the week in Coordinated Universal Time (UTC).
void setUTCFullYear(int year) Sets the year to four-digit number in full year in Coordinated Universal Time (UTC).
void setUTCHours(int hours) Sets the hour on 24 hour clock to hour indicated in hour in Coordinated Universal Time (UTC). The Midnight hour is hour 0.
void setUTCMilliseconds(int millis) Sets the milliseconds within the second to the value in milliseconds in Coordinated Universal Time (UTC).
void setUTCMinutes(int minutes) Sets the minutes within the hour in Coordinated Universal Time (UTC).
void setUTCMonth(int month) Sets the month to the number indicated in month number. January is the first month and is equal to 0. Number must be a valid month 0-11 in Coordinated Universal Time (UTC).
void setUTCSeconds(int seconds) Sets the seconds within the minute to the value in seconds in Coordinated Universal Time (UTC).
Date toNativeDate() Converts a TWDate into a JavaScript Date object.

TWDocument

Represents a document.

Property Summary
TWDocument[] allVersions Returns an array containing all versions of the document.
String contentType Returns the content type of the document.
boolean hideInPortal Returns whether the document is hidden in Portal.
String id Returns the id of the document.
TWDate modificationDate Returns the modification date of the document.
TWUser modifiedBy Returns the user who modified the document.
String name Returns the name of the document.
TWProcessInstance processInstance Returns the process instance to which this document belongs.
String type Returns the type of the document (either TWDocument.Types.File or TWDocument.Types.URL).
TWDocumentTypes Types Contains constant values for document types.
String uri Returns the file name of the document.
int version Returns the version number the document.
Method Summary
TWDocument addVersion(String type , String fileLocation , TWUser user) Creates a document of the specified type (either TWDocument.Types.File or TWDocument.Types.URL) with the specified file name (and optionally the specified user), and returns the created document.
void deleteAllVersions() Deletes all versions of this document.
void writeDataToFile(String filename) Writes the data to the specified file name if the document is of type TWDocument.Types.File; otherwise, it does nothing.

TWDocumentSearchTypes

Constant values for possible document search types.

Property Summary
String All All properties must be the same to return the document.
String Any Any property must be the same to return the document.

TWDocumentTypes

Constant values for document types.

Property Summary
String File The document represents a file.
String URL The document represents a URL.

TWLogger

Helper class allowing to log errors, warning and debugs to the 'tw-javascript.log'. This class is available as 'log' variable in all javascript fields in IBM BPM.

Property Summary
boolean debugEnabled Returns 'true' if Debug level logging is enabled in the log4j configuration file.
boolean infoEnabled Returns 'true' if Info level logging is enabled in the log4j configuration file.
Method Summary
void debug(String text) Writes to the 'tw-javascript.log' with DEBUG severity. If the level is set higher than DEBUG in the log4j configuration, this method might not log anything.
void error(String text) Writes to the 'tw-javascript.log' with ERROR severity. If the level is set higher than ERROR in the log4j configuration, this method might not log anything.
void info(String text) Writes to the 'tw-javascript.log' with INFO severity. If the level is set higher than INFO in the log4j configuration, this method might not log anything.
void warn(String text) Writes to the 'tw-javascript.log' with WARNING severity. If the level is set higher than WARNING, this method might not log anything.

TWManagedFile

Represents a managed file for a particular snapshot of a Process App/Toolkit.

Property Summary
String id The id of the managed file.
String name The name of the managed file.
String path The relative path of the managed file. In IBM BPM, this is the same as the name.
TWManagedFileTypes Types Returns the types of Managed file.
String url The url which can be used to refer to the file (if type is Web).
Method Summary
String getTypeName() Returns the name of the type.
String readText() Reads the text of the managed file. This assumes that the file is a text file and not binary. If the file is binary, this call will likely fail with a conversion error or possibly succeed and return garbage. This call should be considered for use in high-performance runtime situations. Note: this operation is not recommended for large files as the entire text of the file will be loaded in memory.
String writeDataToFile(String newFileLocation) Saves the data (text or binary) into the given location. This function can be useful when a file needs to be stored on the local server during Installation.

TWManagedFileTypes

Contains constants for managed file types.

Property Summary
String Design Constant to denote files like XSL that can be associated with Coach designer.
String Server Constant to denote files like JAR, JavaScript, etc. that can be used in server side scripts.
String Web Constant to denote files like PNG, JPEG, CSS, HTML, etc. that can be used for UI representation in the browser.

TWModelNamespace

the 'tw.system.model' object contains useful functions to get model objects.

Property Summary
TWEnvironmentNamespace env The env variable namespace.
TWProcessApp processApp The current process application.
TWProcessAppSnapshot processAppSnapshot The current process app snapshot.
TWSearchMetaData searchMetaData Information about columns that can be used for searching.
Method Summary
TWManagedFile findManagedFileByPath(String managedFilePath , String managedFileType) Returns a managed file given its file path and the type of managed file, e.g. Web or Server. Starts with the Process App and then looking into its Toolkits.
TWParticipantGroup findParticipantGroupByID(String participantGroupId) Returns the participant group with the given external id.
TWParticipantGroup findParticipantGroupByName(String participantGroupName) Returns the participant group with the given name.
TWProcessApp findProcessAppByAcronym(String processAppAcronym) Returns the process app with the given Acronym.
TWProcessApp findProcessAppByID(String processAppID) Returns the process application with the given ID.
TWProcessApp findProcessAppByName(String processAppName) Returns the process application with the given Name.
TWProcess findProcessByName(String processName) Returns the process with the given name.
TWService findServiceByName(String serviceName) Returns the service with the given name.
TWProcessApp[] getAllProcessApps( boolean includeToolkits) Returns a array of all process apps in the system, optionally including Toolkits.
TWProcessApp[] getAllToolkits() Returns all the toolkits in the system.

TWObject

TWObject can have a number of attributes and properties depending on its setup. They can all be accessed by doing object. or object[""].

Property Summary
int arrayLength Deprecated. arr.arrayLength is deprecated. Use arr.listLength instead.
Returns the length of the list properties of this object.
#[] listAllSelected Returns an array of all of the selected items in this array. The items are returned ordered so that the most recently selected item is in position 0 and the least recently selected at the end.
Integer[] listAllSelectedIndices Returns an array of all of the selected indices of this array. The indices are returned ordered so that the most recently selected index is in position 0 and the least recently selected at the end.
int listLength Returns the length of the list properties of this object.
# listSelected Returns the most recently selected item in the array or undefined if there are no selected items.
Integer listSelectedIndex Returns the index of the most recently selected item in the array or -1 if there are no selected indices.
String[] propertyNames Returns the names of the properties defined in this object as an Array.
Method Summary
Array arrayToNativeArray() Deprecated. arrayToNativeArray is Deprecated. Use listToNativeArray instead.
Converts this TWObject array to a Native JavaScript Array object.
XMLElement describe() Returns an xml structure of the properties and structure associated with this object. This is very useful for debugging.
String getTypeName() Returns the name of the type.
void insertIntoArray(int position , ANY object) Deprecated. use insertIntoList() instead.
Adds a value to the list in a particular position. The list will be resized to fit the objects.
void insertIntoList(int position , ANY object) Adds a value to the list in a particular position. The list will be resized to fit the objects.
void listAddSelected(int index) Adds an item from the list of selected items.
void listClearAllSelected() Removes all items from the selection list.
boolean listIsSelected(int index) Returns true if item index is selected, false if not.
void listRemoveSelected(int index) Removes an item from the list of selected items.
Array listToNativeArray() Converts this TWObject array to a Native JavaScript Array object.
void remove(String propertyName) Removes a property from this object.
void removeIndex(int listIndex) Removes a value from the list. The list will be resized to fit the remaining objects.
XMLElement toXML() Returns an xml structure of the properties associated with this object.
String toXMLString() Returns an xml structure as String of the properties associated with this object.

TWParticipantGroup

Contains useful methods to access the participant group.

Property Summary
TWUser[] allUsers Returns a list of all users which are direct or indirect members of the participant group.
TWRole associatedRole Returns a particpant group's associated role.
String id Returns a particpant group's Id.
String name Returns a particpant group's name.
TWProcessApp processApp Returns a particpant group's process app.
TWRole[] roles Returns a list of roles which are direct members of the participant group.
TWProcessAppSnapshot snapshot Returns a particpant group's process app.
TWUser[] users Returns a list of users who are direct members of the participant group.
Method Summary
void addRoles(TWRole roles) Add the roles(s) to the role.
void addUsers(TWUser users) Add the user(s) to the role. Accepts as input (TWUser|TWUser[]|String|String[]).
String getTypeName() Returns the name of the type.
boolean hasUser(TWUser user) Returns a role's name. Accepts a username or a TWUser object.
void refresh() Refresh the associated runtime role membership. Note: this is done automatically with add/remove functions.
void removeRoles(TWRole roles) Remove the roles(s) from the role.
void removeUsers(TWUser users) Remove the user(s) from the role. Accepts as input (TWUser|TWUser[]|String|String[]).

TWProcess

Represents a BPD.

Property Summary
TWObject*ConditionalActivity conditionalActivities Hierarchical list of conditional activities in current BPD.
String description The description of the BPD.
String guid The GUID of this business process.
String id The id of the BPD (externalized form of ID).
String name The name of the BPD.
TWSearchMetaData searchMetaData Information about columns that can be used for searching.
Method Summary
String getTypeName() Returns the name of the type.
TWProcessInstance startNew( Map inputParams) Starts a process instance.

TWProcessApp

A Process App/Toolkit object.

Property Summary
String acronym The acronym of the process app or a toolkit.
TWProcessInstance[] activeInstances An array of all active instances of this Snapshot.
TWProcessAppSnapshot currentSnapshot The snapshot of the current process app that is currently being executed or installed.
TWProcessAppSnapshot defaultSnapshot The snapshot of the current process app that is designated as default. When set, this property changes the default snapshot in Process Portal.
String id The identifier (externalized ID) of the process app or toolkit.
boolean isToolkit Returns a Boolean value; true if the process app represents a reusable toolkit, otherwise false.
String name The name of the process app or toolkit.
TWProcessAppSnapshot[] snapshots Returns a JavaScript array of all of the snapshots of the current process app on a Teamworks Process Server or Process Center. If on Process Center, excludes archived snapshots. This list returns the snapshots in the order of oldest to newest based on the snapshot creation date.
Method Summary
TWProcessAppSnapshot findSnapshotByID(String snapshotID) Returns the Snapshot of this Process App by its ID.
TWProcessAppSnapshot findSnapshotByName(String snapshotName) Returns the Snapshot of this Process App by its name.
String getTypeName() Returns the name of the type.

TWProcessAppDefaults

Contains the defaults for this version of the Process App/Toolkit.

Property Summary
TWManagedFile coachCSS The default coach CSS.
TWManagedFile coachTransformXSL The default coach designer transform XSL.
Method Summary
String getTypeName() Returns the name of the type.

TWProcessAppSnapshot

A Process Application object.

Property Summary
TWProcessInstance[] activeInstances An array of all active instances of this Snapshot.
TWDate dateCreated The date the Snapshot was created.
TWDate dateInstalled The date the Snapshot was installed.
TWProcessAppDefaults defaultSettings The default Process App/Toolkit settings.
String id The ID of the Snapshot.
boolean isActive Whether or not the Snapshot is active.
String name The name of the Snapshot.
TWProcessApp processApp The Process App/Toolkit of this Snapshot.
Method Summary
void activate() Activates the Process App if it is inactive and it is not a Toolkit, otherwise ignored.
void deactivate() Deactivates the Process App if it is active and it is not a Toolkit, otherwise ignored.
TWManagedFile findManagedFileByPath(String managedFilePath , String managedFileType) Returns a managed file given its file path and the type of managed file, e.g. Web or Server.
TWParticipantGroup findParticipantGroupByName(String participantGroupName) Find a Particpant Group by name.
TWProcess findProcessByName(String processName) Find a BPD by name.
TWService findServiceByName(String snapshotName) Find a Service by name.
String getTypeName() Returns the name of the type.

TWProcessInstance

Represents a process instance.

Property Summary
TWAdhocStartingPoint[] adhocStartingPoints A JavaScript array of all ad hoc starting points currently available on the process instance.
Map businessData The business data for the instance.
TWDocument[] documents A JavaScript array of all documents associated with the instance.
TWDocumentSearchTypes DocumentSearchTypes Contains constant values for possible document search types.
TWDate dueDate The due date.
String id The ID of the instance (externalized form of ID).
String name The name of the instance.
TWProcess process The BPD of the instance.
TWProcessApp processApp The Process App/Toolkit of the instance.
TWObject*String selectedConditionalActivities List of Conditional Activities that have been selected. Can be null and can be set.
String sharepointSiteURL The SharePoint Site URL.
TWProcessAppSnapshot snapshot The particular snapshot of the instance.
String status The current status of the process instance.
TWProcessInstanceStatuses Statuses Types of statuses.
TWTask[] tasks A JavaScript array of all tasks for the instance.
Method Summary
void abort() Aborts the instance.
void addComment(String comment) Adds a comment to the instance.
TWDocument addDocument(String type , String name , String fileLocation , boolean hideInPortal , TWUser createdBy , Map properties) Adds a document to the instance. If the type is File, fileLocation should reference the file on the server, otherwise it should reference the new URI.
TWAdhocStartingPoint findAdhocStartingPointByID(String adhocStartingPointID) Finds an ad hoc activity so that it can be started.
TWAdhocStartingPoint findAdhocStartingPointByName(String adhocStartingPointName) Finds an ad hoc activity so that it can be started.
TWDocument[] findDocuments(Map properties , String searchType) Finds and returns a JavaScript array of documents of the instance that match the given properties.
String getTypeName() Returns the name of the type.
void migrateTo(TWProcessAppSnapshot snapshot) Migrates instance to the given Snapshot.
void resume() Resumes the instance, whether suspended or in a failed state.
void sendHelpRequest(String sendTo , String description) Sends a help request to the given user/group.
void suspend() Suspends the instance.

TWProcessInstanceStatuses

Constants to represent statuses of TWProcessInstance.

Property Summary
String Active BPD instance is in active state.
String Completed BPD instance has been completed.
String DidNotStart BPD instance has not been started because start message event condition returned false.
String Failed BPD instance failed due to runtime error.
String Suspended BPD instance has been suspended.
String Terminated BPD instance has been terminated.

TWReport

From this object one can access aspects of the report definition.

Property Summary
epv Accessor object for Exposed Process Variables that are associated with the report.
boolean isEmbedded Returns a boolean whether a page is embeded in a scoreboard (only valid inside a page).
String name The name of the report.
String pageName The page name of the current rendered page (only valid inside a page).
Method Summary
String applyFilter(String filterName , String value) Sets the value for the filter and returns the new value.
String createPageLink(String reportPageName , String linkText) (pageName, linkText) creates HTML where you can click on 'linkText' to get to pageName. If embedded this returns the same as createPageLinkInNewWindow().
String createPageLinkInNewWindow(String reportPagename , String linkText) Returns an HTML link to open the given report page in a new window.
String displayDefaultPage() Returns the rendered HTML of the default page.
String displayPage(String reportPageName) Prepares and returns HTML for the given report page.
TWReport getByName(String reportName) Returns a report object given its name.
TWChart getChartInstance(String chartName) retrieves a TWChart instance setup after the report chart specifications.
Array getFilterParameters() Returns a list of all current parameters.
String getFilterValue(String filterName) Returns the filter value.
String getPageId(String reportPageName) Returns the given report page ID.
String getPageURL(String reportPageName) Returns the URL for the given report page.
String getPortalPageURL(String reportPageName) Returns the portal URL for the given report page.
String getTypeName() Returns the name of the type.
String linkPageInNewWindowURL() Returns a link in another target.
String linkPageURL() Returns a link to another report page. If embeded this returns the same as linkPageInNewWindowURL(pageName).
void removeFilterValue(String filterName) Removes the filter value. The default will be used.
void setFilterValue(String filterName , String value) Sets the filter value.

TWReportFilter

This object exists in Report Filter Layouts only. It is used to give access to runtime and author set values of a report filter.

Property Summary
String content The original content this filter is replacing. In a where clause filter this is generally the actual where clause you want to turn on and off. In replace text filters, this is normally the default value.
String defaultValue The default value given to this filter in the report datasource.
String label The label given to this filter in the report datasource.
String name name of report filter. This is the name used by report.applyFilter(), report.setFilterValue() and report.getFilterValue(). It is set in the report datasource this filter is attached to. Do not confuse this with the name of the layout.
String value The current value as given either from the default value, a manually set report filter value or the HTML page value given to this filter.

TWRole

Contains useful methods to access the Role.

Property Summary
TWObject*TWUser allUsers A JavaScript array of all users of this role, users of its contained roles, etc. This should clean the list so that a user only shows up once no matter how many roles they are in. Also, all users from external security groups should get pulled into this list, regardless of whether they have logged in.
TWObject*TWRole children Deprecated. Use the managedTeamRoles property on the TWRole object
Returns a role's immediate children.
TWObject*TWRole containerRoles Returns a list of roles which this role is a member of.
int id Returns a role's Id.
TWObject*TWRole managedTeamRoles A JavaScript array of teams managed by this role.
String name Returns a role's name.
TWRole parent Deprecated. Use the teamManagerRole property on the TWRole object
Returns a role's parent.
TWObject*TWRole roles Returns a role's role members.
TWRole teamManagerRole Returns the manager role for My Team Performance.
TWObject*TWUser users Returns a role's user members.
Method Summary
void addRoles( TWRole roles , TWRole[] roles , String roles , String[] roles) Add the roles(s) to the role.
void addUsers( TWUser users , TWUser[] users , String users , String[] users) Add the user(s) to the role.
TWRole[] getChildren() Deprecated. use property children
Returns a role's immediate children.
int getId() Deprecated. use property id
Returns a role's Id.
String getName() Deprecated. use property name
Returns a role's name.
TWRole getParent() Deprecated. use property parent
Returns a role's parent.
String getTypeName() Returns the name of the type.
TWUser[] getUsers() Deprecated. use property users
Returns a role's members.
void removeRoles( TWRole roles , TWRole[] roles , String roles , String[] roles) Remove the roles(s).
void removeUsers( TWUser users , TWUser[] users , String users , String[] users) Remove the user(s) from the role.

TWSavedSearch

Represents a saved search object.

Property Summary
String id The id of the saved search.
String name The name of the saved search.
TWSearch search The search object representing the actual search object.
Method Summary
String getTypeName() Returns the name of the type.

TWScoreboard

Represents a scoreboard object.

Property Summary
String id The id of the scoreboard.
String name The name of the scoreboard.
String systemID The system id of the scoreboard.
String url The url of the scoreboard.
Method Summary
String getTypeName() Returns the name of the type.

TWSearch

Contains properties and methods for search.

Property Summary
TWSearchColumn[] columns An array of columns to return in the search.
TWSearchCondition[] conditions An array of conditions to use in the search.
TWSearchOrdering[] orderBy An array of orderings used for the results of the search.
TWSearchOrganizeByTypes OrganizeByTypes Returns the search results organized by constants.
String organizedBy How the search is organized (task or process instance). See TWSearch.OrganizeByTypes for valid constants.
Method Summary
TWSearchResults execute( TWUser | TWRole | String userOrRole , Integer maxRows , Integer beginIndex) Executes this search against the given user or role. If userOrRole is empty or null, the search should execute without filtering. If a filter is used, it should be the same filtering that occurs in the web API (i.e. based on the user and all of their roles, not just the user itself).
TWProcessInstance[] executeForProcessInstances( TWUser | TWRole | String userOrRole , Integer maxRows , Integer beginIndex) Executes this search against the given user or role returning a JavaScript array of process instances. If userOrRole is empty or null, the search should execute without filtering. If a filter is used, it should be the same filtering that occurs in the web API (i.e. based on the user and all of their roles, not just the user itself).
TWTask[] executeForTasks( TWUser | TWRole | String userOrRole , Integer maxRows , Integer beginIndex) Executes this search against the given user or role returning a JavaScript array of tasks. If userOrRole is empty or null, the search should execute without filtering. If a filter is used, it should be the same filtering that occurs in the web API (i.e. based on the user and all of their roles, not just the user itself).
String getTypeName() Returns the name of the type.

TWSearchColumn

Contains properties for search column.

Property Summary
String name Returns name of the column.
TWSearchColumnProcessColumns ProcessColumns Returns the searchable column names for a Process.
TWSearchColumnProcessInstanceColumns ProcessInstanceColumns Returns the searchable column names for a Process Instance.
TWSearchColumnTaskColumns TaskColumns Returns the searchable column names for a Task.
String type Returns the type of search column from TWSearchColumnTypes.Types.
TWSearchColumnTypes Types Returns the search column type constants.
Method Summary
String getTypeName() Returns the name of the type.

TWSearchColumnMetaData

Search column information for returning and querying against columns.

Property Summary
boolean isUsableInSearchCondition Whether or not this column can be used for the query. If not, it can only be used in the results.
String name The name of the column.
String type The column type (one of TWSearchColumn.Types).
String valueType The type of the value for the column (one of TWSearchColumnMetaData.ValueTypes).
TWSearchColumnMetaDataValueTypes ValueTypes A set of constants for the value types of the search metadata.
Method Summary
String getTypeName() Returns the name of the type.

TWSearchColumnMetaDataValueTypes

Value types of the search column metadata.

Property Summary
String Boolean Searchable bussiness data is of type Boolean
String DateTime Searchable bussiness data is of type DateTime
String Decimal Searchable bussiness data is of type Decimal
String Integer Searchable bussiness data is of type Integer
String String Searchable bussiness data is of type String

TWSearchColumnProcessColumns

Contains constants for searchable column names of a Process.

Property Summary
String Name Searching BPD instances or tasks by BPD name.

TWSearchColumnProcessInstanceColumns

Contains constants for searchable column names of a Process Instance.

Property Summary
String DueDate Searching BPD instances or tasks by instance due date.
String ID Searching BPD instances or tasks by instance ID.
String Name Searching BPD instances or tasks by instance name.
String ProcessApp Searching BPD instances or tasks by process application name.
String Snapshot Searching BPD instances or tasks by snapshot name.
String Status Searching BPD instances or tasks by instance status.

TWSearchColumnTaskColumns

Contains constants for searchable column names of a Task.

Property Summary
String Activity Searching BPD instances or tasks by task activity name.
String AssignedToRole Searching BPD instances or tasks by role that task is assigned to.
String AssignedToUser Searching BPD instances or tasks by user that task is assigned to.
String ClosedBy Searching BPD instances or tasks by user who closed the task.
String ClosedDate Searching BPD instances or tasks by date when task was closed.
String DueDate Searching BPD instances or tasks by task due data.
String ID Searching BPD instances or tasks by task ID.
String Priority Searching BPD instances or tasks by task priority.
String ReadDate Searching BPD instances or tasks by date when task was read.
String ReceivedDate Searching BPD instances or tasks by date when task was received.
String ReceivedFrom Searching BPD instances or tasks by user that task was received from.
String SentDate Searching BPD instances or tasks by date when task was sent.
String Status Searching BPD instances or tasks by task status.
String Subject Searching BPD instances or tasks by task subject.

TWSearchColumnTypes

Contains constants for search column types operations.

Property Summary
String BusinessData Searching BPD instances or tasks using business data properties in criteria.
String Process Searching BPD instances or tasks using BPD properties in criteria.
String ProcessInstance Searching BPD instances or tasks using instance properties in criteria.
String Task Searching BPD instances or tasks using task properties in criteria.

TWSearchCondition

Contains properties for a search condition.

Property Summary
TWSearchColumn column The search column to apply the condition to.
TWSearchConditionOperations Operations Returns the search results organized by constants.
TWSearchConditionOperations operator The search condition operator.
TWObject value The search column to apply the condition to.
Method Summary
String getTypeName() Returns the name of the type.

TWSearchConditionOperations

Contains constants for search condition operations.

Property Summary
String Contains Searching data should contain specified value.
String Equals Searching data should be equal to specified value.
String GreaterThan Searching data should be greater than specified value.
String LessThan Searching data should be less than specified value.
String NotEquals Searching data should not equal to specified value.
String StartsWith Searching data should start with specified value.

TWSearchMetaData

Used to describe data that can be used to perform searches.

Property Summary
TWSearchColumnMetaData[] columns A JavaScript array of column information that can be used for searching.
Method Summary
String getTypeName() Returns the name of the type.

TWSearchOrdering

Contains properties for search ordering.

Property Summary
TWSearchColumn column Returns the search column the ordering refers to.
String order Returns the search order.
TWSearchOrderingOrders Orders Returns the search results organized by constants.
Method Summary
String getTypeName() Returns the name of the type.

TWSearchOrderingOrders

Contains constants for search orders operations.

Property Summary
String Ascending Search result is ordered ascendingly.
String Descending Search result is ordered descendingly.

TWSearchOrganizeByTypes

Contains constants for task organized by types.

Property Summary
String ProcessInstance Order by process instance.
String Task Order by Task.

TWSearchResultRow

Search results row object.

Property Summary
TWObject[] values The search results row values.
Method Summary
String getTypeName() Returns the name of the type.

TWSearchResults

Search results object.

Property Summary
TWSearchColumnMetaData[] columns The columns in the results.
TWSearchResultRow[] rows The rows in the results.
Method Summary
String getTypeName() Returns the name of the type.

TWService

Represents an executable service.

Property Summary
String id The ID of the service.
String name The name of the service.
String type The type of the service.
TWServiceTypes Types Returns the types of services.
Method Summary
Map execute( Map inputParams) Executes a service with the given input, returning the output parameters.
String getTypeName() Returns the name of the type.

TWServiceTypes

Constants to represent types of services.

Property Summary
String Ajax Service that can be used in Coach controls that support asynchronous server calls using Ajax.
String GeneralSystem General-purpose service that can be used as a system task.
String Human Service that is designed for user interaction.
String Installation Service that is executed during installation of process application.
String Integration Service that contains integration components for Web Services, Java reflection, etc.
String Rule Service that can be used in decision gateways.

TWTask

Contains useful methods to access the Role.

Property Summary
TWObject assignedTo The TWUser or TWRole that the task is currently assigned to.
TWDate dueDate The task due date.
String id Returns the task Id.
String narrative The task narrative.
TWTaskPriorities Priorities Returns the task priorities constants.
String priority The task priority.
String processActivityDescription The description of the process activity associated with the task.
String processActivityName The name of the process activity associated with the task.
TWProcessInstance processInstance The process instance associated with the task.
TWProcessStepInfo processInstanceStep The step in the parent process instance.
String status The task status.
TWTaskStatuses Statuses Returns the task statuses constants.
String subject The task subject.
Method Summary
void complete(TWUser user , Map outputValues) Completes the task. This is generally used in conjunction with external activities.
String getTypeName() Returns the name of the type.
void reassignBackToRole() Reassigns the task to it's original Role.
void reassignTo(TWUser usersOrRoles) Reassigns the task to the given user(s) and/or role(s). Accepts a single TWUser Object.
void reassignTo(TWRole usersOrRoles) Reassigns the task to the given user(s) and/or role(s). Accepts a single TWRole Object.
void reassignTo(TWTeam usersOrRoles) Reassigns the task to the given user(s) and/or role(s). Accepts a single TWTeam Object.
void reassignTo(String usersOrRoles) Reassigns the task to the given user(s) and/or role(s). Accepts a single String that can be comma-delimited. The users and/or roles will be matched by username/role name, roles being matched only if prefixed by "ROLE:" (usernames needn't be prefixed by "USER:" but can be).
void reassignTo(Array usersOrRoles) Reassigns the task to the given user(s) and/or role(s). Accepts a JS array of TWUsers, TWRoles or Strings. The JavaScript array can be filled with any of TWUser, TWRole, TWParticipantGroup or String, so the array could contain a TWUser, a TWRole, and a TWParticpantGroup, for instance.
void reassignTo(String[] usersOrRoles) Reassigns the task to the given user(s) and/or role(s). Accepts a TW list of Strings. The users and/or roles will be matched by username/role name, roles being matched only if prefixed by "ROLE:" (usernames needn't be prefixed by "USER:" but can be).
void start(TWUser user) Starts the task with the given user. This effectively just sets the start time of the task.

TWTaskPriorities

Contains constants for priority types.

Property Summary
String High High Priority.
String Highest Highest Priority.
String Low Low Priority.
String Lowest Lowest Priority.
String Normal Normal Priority.

TWTaskStatuses

Contains constant values for possible statuses.

Property Summary
String Actioned Task is closed.
String Closed Task is closed.
String Deleted Task was deleted.
String Forwarded Task was forwarded.
String New Task was created by and assigned to the current user.
String Received Task was created by and assigned to some user or role.
String Replied Task was replied.
String Sent Task was sent.
String Special Description N/A

TWTimerInstance

An instance of a timer waiting.

Property Summary
String id The instance ID of the timer.
Method Summary
String getTypeName() Returns the name of the type.

TWUser

Contains useful methods to access the User.

Property Summary
Record attributes Returns all the user's attributes.
String fullName Returns a user's full name.
int id Returns a user's Id.
String name Returns a user's name.
TWObject*TWParticipantGroup participantGroups Returns all the participant groups the user is a member of.
TWRole primaryRole Deprecated. deprecated
Returns the primary role of the user.
TWRole primaryRoleParent Deprecated. deprecated
Returns the parent of the primary role of the user.
TWObject*TWRole roles Returns all the roles the user is a member of.
TWSavedSearch[] savedSearches An array of all saved portal searches the user has access to.
TWScoreboard[] scoreboards An array of all scoreboards the user has access to.
Method Summary
Map getAttributes() Deprecated. use property attributes
Returns all the user's attributes.
String getFullName() Deprecated. use property fullName
Returns a user's full name.
int getId() Deprecated. use property id
Returns a user's Id.
TWUserLocalePreferences getLocalePreferences(ANY user) Sets the locale preferences for a user.
String getName() Deprecated. use property name
Returns a user's name.
TWRole getPrimaryRole() Deprecated. use property parimaryRole
Returns the primary role of the user.
TWRole getPrimaryRoleParent() Deprecated. use property primaryRoleParent
Returns the parent of the primary role of the user.
TWRole[] getRoles() Deprecated. use property roles
Returns all the roles the user is a member of.
String getTypeName() Returns the name of the type.
boolean isInParticipantGroup(TWParticipantGroup participantGroup) Tells if the user is a member of the Participant Group.
boolean isInRole( String roleName , TWRole role) Tells if the user is a member of the Role.
void removeAttribute(String name) Removes the given attribute and all of its values for this user.
void setAttributeValue(String name , String value) Set the attribute with the supplied name to the supplied value. The attribute is created if it does not already exist, otherwise its value is replaced. The attribute is in no namespace.
void setLocalePreferences(ANY user , TWUserLocalePreferences localePreferences) Sets the locale preferences for a user.

TWUserLocalePreferences

Holds information about a user's locale preferences.

Property Summary
String locale Holds a locale in standard format: [_[_variant]]. For example, 'en', 'en_US'.
String localeCountry Returns the country/region code for this locale, which will either be the empty string or an uppercase ISO 3166 2-letter code.
String localeDisplayCountry Returns a name for the locale's country that is appropriate for display to the user.
String localeDisplayLanguage Returns a name for the locale's language that is appropriate for display to the user.
String localeDisplayName Returns a name for the locale that is appropriate for display to the user.
String localeDisplayVariant Returns a name for the locale's variant code that is appropriate for display to the user.
String localeLanguage Returns the language code for this locale, which will either be the empty string or a lowercase ISO 639 code.
String localeVariant Returns the variant code for this locale.

XMLDocument

Represents an XML Document.

Method Summary
XMLElement createElement(String elementName) Create and return a new XMLElement. The newly created XMLElement is not part of the XMLDocument used to create it. Use the insert methods on the correct parent element to add the newly created element in the correct location.
XMLElement getElementByTagName(String tagName) Return the root element of the document if it has the name tagName.
XMLNodeList getElements() Return a list consisting of the single document root element.
String toString( boolean deep) Return a sting representation of the document. If the deep parameter is set to true the whole document is returned as a string, otherwise just the root element is converted and returned.
String transform(String fileName) This function transforms the current document using XSLT. Returns String representation of the result of transformation.
XMLNodeList xpath(String xPathExpression) Apply the provided XPath expression to the document and return the list of Elements selected by the expression. Note that this only returns elements and not other content types.

XMLElement

Represents an XML Element.

Property Summary
XMLNodeList childNodes Return a list of all of the child elements underneath this element.
XMLElement firstChild Return the first child element underneath this element, or null if this element has no children.
XMLElement lastChild Return the last child element underneath this element, or null if this element has no children.
String namespaceURI The namespace URI of this element. This will be the default namespace URI if the element has no prefix.
XMLElement nextSibling Return the next sibling element of this element or null if this element has no next sibling.
XMLDocument ownerDocument Return the document containing this element, or null if the element is not in any document.
XMLElement parentNode Return the parent element of this element or null if this element has no parent, including if it is the root element of its containing document.
XMLElement previousSibling Return the previous sibling of this element or null if this element has no previous sibling.
String tagName Return the name of the current element.
Method Summary
XMLElement appendChild(XMLElement newChild) Append newChild to the end of the list of children of this element. Return newChild.
XMLElement cloneNode( boolean deep) Return a clone of this element. If deep is true children are also cloned recursively.
String getAttribute(String attributeName) Return the value of the attribute with the specified name, or null if there is no such element.
String getAttributeNS(String namespaceURI , String attributeName) Return the value of the attribute identified by the namespaceURI and localName.
XMLNodeList getElementByTagName(String tagName) Returns an XMLNodeList of all child elements of the current element that have the given name. If no child elements have the given name, returns an empty XMLNodeList.
XMLNodeList getElementsByTagNameNS(String namespaceURI , String localName) Return a list of all of the children of the current element that have the specified localName and namespaceURI.
String getText() Return the text contents of the current element, or null if no text.
boolean hasChildNodes() Return true if this element has any child elements.
XMLElement insertBefore(XMLElement newChild , XMLElement refChild) Insert a new element, newChild, as a child of this element before its existing child, refChild. Return newchild.
void removeAttribute(String name) Remove the attribute with the supplied name and no namespace from the element.
void removeAttributeNS(String namespaceURI , String name) Remove the attribute identified by namespaceURI and localName.
XMLElement removeChild(XMLElement oldChild) Remove the child, oldChild, of this element. Return oldChild.
XMLElement replaceChild(XMLElement newChild , XMLElement oldChild) Replace the child, oldChild, of this element with a new child, newChild. Return newChild.
void setAttribute(String name , String value) Set the attribute with the supplied name to the supplied value. The attribute is created if it does not already exist, otherwise its value is replaced. The attribute is in no namespace.
void setAttributeNS(String namespaceURI , String name , String value) Set the value of the attribute identified by namespaceURI and localName to value.
void setText(String text) Set the text contents of the current element to the supplied value, replacing any existing text and/or element content.
String toString( boolean deep) Return a sting representation of the document. If the deep parameter is set to true the whole document is returned as a string, otherwise just the root element is converted and returned.
String transform(String fileName) This function transforms the current document using XSLT. Returns String representation of the result of transformation.NOTE: XSLT only works on documents, so this call assumes that this element is a root element of a document. All XPATHs etc should assume that this is the root.
XMLNodeList xpath(String xPathExpression) Return the list of nodes that are selected by the xpath expression when applied to this element.NOTE: XSLT only works on documents, so this call assumes that this element is a root element of a document. All XPATHs etc should assume that this is the root.

XMLNodeList

Represents a list of XMLElements.

Property Summary
int length The number of items in the list.
Method Summary
XMLElement item(Integer index) The item at position index.