Skip to content

Patch Producer

Simon Mourier edited this page Feb 19, 2020 · 1 revision

The Patch Producer (a.k.a. “Search And Replace” Producer) is a producer that lets you "patch" any text file using regular expressions. Basically, if ever for some reason a produced output doesn't suit you, and the modeling engine doesn't provide any option to modify this output, you could use the Patch Producer to "patch" the generated output.

As other producers, to add it, you must click on the “Add New Producer” context menu of the Producers folder node:

Patch Producer - Picture 294

Here we add a patch (you can add multiple patches and in the order of your choice):

  • this patch will search for *.sql files in the Persistence path. Search Pattern is a file filter expression. Only used if Path value is a directory. Path is a directory relative to the project model directory path.

  • in each matching files, it will search for the ID(?<name>.)* regulation expression. Search Pattern is a regular expression defining matching groups (see regex documentation for matching groups syntax).

  • it will replace each matching group using the Replace value attribute. The Replace value is a comma separated list of key=value pairs, with a group name as the key, and the replacement string as the value. Groups are the same as in the Search Pattern value.

Clone this wiki locally