Introduction
The Execute Tool offers you the possibility to couple with other system or services. Suppose you want to store data in an external database or you want to fetch some date from a webservice, you can use an Execute Tool for this.
There are two ways the Execute Tool works.
●
|
Using an external application
|
|
1
|
A part (using Path) of the XML document is extracted and copied to disk (location: Start in). The filename is automatically chosen by SoftRules® or you can enter it using the (Formula) field Output filename. You can pass the filename to the executable by using {xmlfilename} as a parameter.
|
2
|
The application (field: Command) is executed
|
3
|
When the application is finished, the XML is being read and copied to the original Path in the XML document. If the application doesn't finish within Time-out (ms) the application will be terminated and a message will appear in the log.
|
|
●
|
Using a Dynamic Link Library (DLL)
|
|
You need to have a custom built DLL for this. The working is almost the same as above, only the DLL will have access to the XML document class in SoftRules®, so the execution will be faster. A DLL can not be stopped if the processing takes too much time, also the DLL can not be replaced when the server is running. Despite this, using a DLL is the most efficient way to call external services. If you want to build such a DLL, please contact us at support@softrules.com, we'll be glad to help you.
|
We call these kind of applications (or DLL's) Agents. Those are custom applications that can execute SQL statements or access webservices and provide the translation of these services to the format of you XML document.
Description
Description of the Execute.
Command
The command that should be executed. This is the name of the application together with it's parameters. One of the parameters should be {xmlfilename} because that parameter will be replaced by SoftRules® with the name of the stored XML fragment. You can also use variables like [#DriversAge] or something like that.
Drop XML
By checking this the Execute Tool can be used to drop an XML Document in a folder. This is also very handy for debugging.
Start in
The application will be started in this folder. This is also the location where the XML will be dropped.
Tip!
|
You can use environment variables in Command and Start in. For example:
%SOFTRULESAGENTS%\myagent.exe
This is very handy if the Agent's folder in your test platform differs from the production platform
|
Run isolated
When using Agents that are not thread safe, you have to use this Run isolated option. If the Agent is running every other thread (coming from another reuest on the same server, or coming from the same process, but in a parallel task) will be queued. Of course this will slow down the performance, so the use of thread safe Agents is recommended.
Run asynchronously
If your Agent is used as a fire and forget job, you can check this option. In that case SoftRules® will continue processing and will not wait for the application to finish. This will increase the speed of the processing. This can be used if you just want to drop an XML in a folder (for example).
Path
This is the path that to define the XML fragment that is used for the Agent.
Include SoftRules Tag
By checking this the XML fragment will contain <SoftRules> rootnode tags.
XML Indented
By checking this the XML fragment will be nicely formatted (easy to read).
Timeout (ms)
Enter the time in milliseconds that the application gets to finish. After this it will be terminated and a message will appear in the log.
Out- en In Adapter
You can format your XML fragment by using the Out Adapter. Don't forget to chose the correct In adapter because the XML has to be reformatted when it's being read in.
Output filename
By default a random filename will be generated for the XML fragment. This is the best option for the sake of multi threading, because otherwise different threads will overwrite each other's files. But sometimes you want to be able to influence the filename. If that's the case, please enter the filename here. It is a Formula field, so you can doubleclick it and use the Value Editor.
Examples:
polivy+[#policyinstance].xml
or
policy+GUID().xml
Element for Exitcode
Agents can return an Exitcode. This way you can find out what the result of the external call exactly was. By entering a Variable name at this spot, you can build your own handler for exitcodes.
Category