WebSphere Lombardi Edition 7.2 > Modeling processes > Advanced modeling tasks


Use embedded JavaScript

You can use JavaScript to implement activities in your business process definitions (BPDs). Lombardi provides full JavaScript support, including calling and creating JavaScript functions, loops, setting variables, and so on. The following resources are available for JavaScript implementations:

Lombardi JavaScript API Provides methods and objects to enable access to Lombardi functions and features. When implementing JavaScript in Lombardi, the type-ahead feature automatically completes your entries so that you are aware of the available objects. For example, if you type tw.system in a JavaScript field, Lombardi returns a list of system functions that you can choose from. To learn more about the JavaScript API, see the reference information posted to the WebSphere Lombardi Edition Documentation Wiki: http://wiki.lombardi.com/display/tw7/Teamworks+7+JavaScript+APIs . (You must have an account for the IBM Customer Support for Lombardi site to access the wiki.)
Managed JavaScript files When you add a JavaScript (.js) file to be managed as part of your project, you can use the functions and variables within the file in the scripts and scriptlets that you develop throughout your Lombardi project.

While Lombardi supports using JavaScript to implement an activity, in most cases it is best to create a service that includes a Server Script component and then use the service to implement the activity.

Follow these steps to implement an activity using embedded JavaScript:

  1. Click to select the activity that you want in the BPD diagram.
  2. Click the Implementation tab in the properties.
  3. Under Implementation, select the Embedded JavaScript option from the drop-down menu.
  4. Type or copy the script into the text box.

    You can press Ctrl+F to use find and replace functionality in the JavaScript editor, including the ability to replace all occurrences.

  5. Save your changes to the activity.

Parent topic: Advanced modeling tasks

+

Search Tips   |   Advanced Search