Example of Tool Agent Used in the Example XPDLs

If you load test-JavaScript.xpdl (or test-BeanShell.xpdl) by using Admin application, you can find out how Tool agents work.

This XPDL have defined extended attributes for application definitions, and these attributes contain data needed to call appropriate tool agents without need for mapping information (these tool agents are called through default tool agent by reading extended attribute parameters). The only thing you should do before starting shark engine is to configure your "Shark.conf" file to define proper settings for DefaultMailMessageHandler, but even if you don't do that, the example will work, because on MailToolAgent failure, it will proceed with DEFAULT_EXCEPTION transition.

If you want to do your own mappings, it will override default configuration in application's XPDL extended attributes because shark first looks at mapping information, and only if it can't find it, it calls Default tool agent, which reads ext. attributes. You can do the following to see how the mappings work:

The process is consisted of two loops:

When you decide to exit both loops, the process goes to "Notepad" or "Vi editor" activity, depending on OS that engine runs on, and appropriate text editor will be started on shark machine using RuntimeApplication tool agent, but process will continue to "Enter Mail Params" activity, because mode of RuntimeApplication tool agent is previously (in mappings) set to 1, which means asynchronous execution of editor application.

Now, you should enter some parameters to send e-mail notification to someone. I.e., enter something like this:

After that, the mail should be sent using MailToolAgent, and process will finish. If this is not the case, it means that you didn't setup appropriate parameters in Shark.conf file, so exception in tool agent will happen, but since XPDL has defined DEFAULT_EXCEPTION transition, the process will proceed to exception handling path -> to activity "Enter Aditional Mail Params". Now, you should enter additional parameters that are needed by email.MailProc class used to send mails through JavaClass tool agent. I.e., enter something like this:

After that, process will be finished no matter if you've entered proper parameters or not.

Now, you can play around with the mappings. I.e., you can enter different java script text for executing math operations, enter different parameter values, ...