IBM BPM, V8.0.1, All platforms > Programming IBM BPM > Developing using the JavaScript API
Samples
This section provides JavaScript samples.
- Starting a new process
A new instance of a process can be started by using the tw.system.startProcessByName() function.- Getting the current process instance
The current process instance can be retrieved through the TWProcessInstance variable called tw.system.currentProcessInstance.- Getting the current userid
The current user ID can be retrieved through the TWUser variable in tw.system.user.- Starting an external application
You can start an external application such as a batch file or a shell script by performing that task using the JavaScript LiveScript mechanism.
- Returning the owner of a task
You can know the identity of a user who has completed a given task.
- Returning a list of reference links
You can return a list of all reference links of the current process application or toolkit on a server by running the tw.system.model.processApp.getLinks() method.
- Extracting a managed file
If a process application or a toolkit contains a managed file, you can extract it from the runtime to evaluate its content.
- Search processes and tasks
You can search a specific task in a current process.
- Calling Java through JavaScript
JavaScript inside IBM BPM can invoke Java through the Live Connect technology.- Work with document attachments
Document attachments can be associated with process instances. These can be added through coach controls or through programmatic additions.- Retrieving data from XML
The following examples show you how to pull data out from an XMLDocument (or any XML type) using the following XML.