Home | Printable Version
1.2: Actions
The Actions are contained in the THEN part of the rule. WebMaker provides a range of actions for performing many common server-side tasks. A new action is added by clicking the Add Action link within the relevant rule container. An action can be removed by clicking the cross button on the right hand side. condition with 'loop on this selection' flag set The list of actions is available in the Action drop-down. The actions are displayed within the rule in the order in which they will be executed. You can drag and drop actions to reorder them as required. You can disable actions by ticking the disabled tick-box. As long as the disable RuleBase Setting is turned on, then disabled actions will never be processed at runtime. Table of Available Actions
Action Description
Assign Sets the value of an element or attribute within the FactBase.
Compare Compares two XML fragments and details the differences between them.
Copy Copies XML fragments from one location to another.
Copy Directory This is used to copy files or directories on the file system from one location to another.
Delete Deletes an XML fragment from the FactBase.
Delete File This is used to delete a file or directory from the file system.
File Information This is used to retrieve information about a file or directory on the file system.
Insert Parses an XML document or fragment into the FactBase.
Insert Attribute Enables the addition of attributes against elements.
Invoke Service This is the main orchestration action. A Service call can be made to any other controller within the Platform. The target controllers may be native to the WebMaker Platform or proxies to remote web services. This action always assumes it is calling a named native controller, but the physical manifestation of this controller can be specified during deployment of the application.
Java Method This is used to invoke arbitrary Java methods, usually within external libraries.
Log Enables the logging of XML information to the underlying Platform logging system.
Move Moves XML fragments from one location to another.
Record Cache Caches a named XML fragment either in Request, User Session or Application scope.
Remove Cache Clears cached XML information.
Retrieve Cache Retrieves named XML information from the cache.
Rename Renames an element or attribute.
Save Saves specified FactBase information to a file on the file system.
SQL Statement This provides the ability to define and execute SQL statements against relational databases.
Terminate This action stops the processing in the current controller and returns to the calling controller or application. The response that will be returned is specified by the RuleBase return XPath.
Transform This is an XSLT operation on specified FactBase content using a specified XSL file.
Validate This validates specified FactBase information using an XSD file.
XML String This is used to convert between XML formatted strings and actual XML data.
XML to JSON Conversion JSON to XML Conversion Converts XML data into JSON formatted strings.
JSON to XML Conversion Handles conversion of JSON formatted strings into XML data.
Merge Option
For every action that inserts new content into the FactBase it is possible to specify a Merge Option setting, to control how the new information will actually be inserted.
The available merge options are:
Append - This is the default option, and will add the content being inserted as a new child element of the element matched by the target XPath. Replace - This option will replace the element matched by the target XPath with the new content being inserted. Any existing content in the target location will be lost. Insert Before - This option will insert the new content as a new sibling immediately before the element matched by the target XPath. Delete and Append - The Replace option, as described above, should be used instead of this option. This option was actually called Replace in earlier WebMaker versions, and is maintained here purely for backwards compatibility. This option is similar to the Replace setting in that the element matched by the target XPath will be deleted, and the new content inserted. However, if the target element was one of a number of sibling elements, then the new content will be added as the very last sibling, regardless of where the target was located.
Examples
For these examples, assume the document content is as shown below: Example document before insert Given a target XPath of /container/second_child, then the following image shows the result of inserting new_content for the different merge options: Example document after insert showing the different merge options
Conditions Assign