Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Can you post an example of the rule? It would be good to see why you need to trim the string in the first place.</p> <p>But you could write a function to do this and expose it via the BOM. This can be done two ways. First, you could write a virtual function directly in the BOM that takes a string and trims it. The second option if you use Java XOM's is to write the function in Java and expose that via the BOM.</p> <p>If your using the virtual function approach, then the code will be written using IRL, but this is essentially a cut down version of Java so it will have the String object methods needed to trim. For example:</p> <pre><code>return theString.trim(); </code></pre> <p>To add a BOM function, do the following steps:</p> <ol> <li>Right click the "bom" folder in the Eclipse rules project.</li> <li>Select "BOM Entry" from the menu.</li> <li>Select the "Create an empty BOM entry" option and then click "Finish".</li> <li>Double click the new BOM entry to bring up the BOM editor view, and then click "New Class".</li> <li>Enter the class name and then click "Finish".</li> <li>Double click the new BOM class from the list, then under the "Members" section, click the "New" button.</li> <li>In the new member dialog box, select the "Method" option, enter a name for the method, and add a parameter as a String type. Finally set the return type as a String type. then click the "Finish" button.</li> <li>Then double click the new method under the "Members" section, and select the "Static" and "Final" options, and create a default verbalisation under the "Member Verbalisation" section.</li> <li>Under the "BOM to XOM Mapping" section, enter the code I put in my original answer above, changing the parameter name to match what you have used.</li> <li>Go back to the class level BOM editor and set the "Execution name" to the value "void" in the "BOM to XOM mapping" section. This is needed because the BOM class is not linked to a Java class (XOM).</li> </ol> <p>Once you have done this, you should then be able to see the new method in the BAL editor for the rule.</p> <p>However, what I would say is that you should try and trim and prepare the data before passing it into the rule set. Ideally you want a little custom functions in the rule set as possible to keep the rules as clean as possible.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload