PrePostfix

PrePostfix

Pre- or postfixes a generated value with a static string. Either specify a sub-generator or run another generator using a Sequential before this one to provide a value.

Attributes
Name Description Required Min Max Allowed Values
name (Class)Name of this element. Used to identify plugin Class. Full name is required. Example: com.en.myPluginPackage.myPuginClass no 0 1
id Identification String of this element. May be used to uniquely identify a field within the children of an Element. no 0 1
Nodes
Name Description Required Min Max Allowed Values
postfix no 0 1
gen Value Generator for this field no 0 1
prefix no 0 1

Examples

  1. Customer ID with Prefix

    Generates IDs starting from 10 (ascending) and prefixes the ID with 'CUSTOMER#'.

    Schema config for Customer ID with Prefix
    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <!--
    /*******************************************************************************
    * Copyright (c) 2013, bankmark and/or its affiliates. All rights reserved.
    * bankmark UG PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
    ******************************************************************************/
    --><schema xmlns:doc="http://bankmark.de/pdgf/doc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="demo" xsi:noNamespaceSchemaLocation="structure/pdgfSchema.xsd">
      <!-- All data is derived from this starting seed.
           If this seed is the same, the generated data will the same on each
           computer/node/platform.
           Change this seed to generate a different data set.-->
      <seed>1234567890L</seed>
    
      <rng name="PdgfDefaultRandom"/>
    
      <!--Default Scale factor for all tables -->
      <property name="SF" type="double">1</property>
    
      <table name="PrePostfix">
        <!-- if tables should scale with -SF command line argument.
             Specify your scaling formula here: -->
        <size>10 * ${SF}</size>
    
        <!--Customer ID with Prefix-->
          <!--Generates IDs starting from 10 (ascending) and prefixes the ID with 'CUSTOMER#'.-->
          <field name="customer_with_prefix" size="" type="VARCHAR">
            <gen_PrePostfix>
              <prefix>CUSTOMER#</prefix>
              <gen_Id>
                <min>10</min>
              </gen_Id>
            </gen_PrePostfix>
          </field>
          </table>
    </schema>
    
    Output for Customer ID with Prefix
    CUSTOMER#10
    CUSTOMER#11
    CUSTOMER#12
    CUSTOMER#13
    CUSTOMER#14
    CUSTOMER#15
    CUSTOMER#16
    CUSTOMER#17
    CUSTOMER#18
    CUSTOMER#19
  2. Price with Currency Symbol (€)

    Generates random integers and adds the Euro currency symbol '€' at the end.

    Schema config for Price with Currency Symbol (€)
    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <!--
    /*******************************************************************************
    * Copyright (c) 2013, bankmark and/or its affiliates. All rights reserved.
    * bankmark UG PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
    ******************************************************************************/
    --><schema xmlns:doc="http://bankmark.de/pdgf/doc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="demo" xsi:noNamespaceSchemaLocation="structure/pdgfSchema.xsd">
      <!-- All data is derived from this starting seed.
           If this seed is the same, the generated data will the same on each
           computer/node/platform.
           Change this seed to generate a different data set.-->
      <seed>1234567890L</seed>
    
      <rng name="PdgfDefaultRandom"/>
    
      <!--Default Scale factor for all tables -->
      <property name="SF" type="double">1</property>
    
      <table name="PrePostfix">
        <!-- if tables should scale with -SF command line argument.
             Specify your scaling formula here: -->
        <size>10 * ${SF}</size>
    
        <!--Price with Currency Symbol (€)-->
          <!--Generates random integers and adds the Euro currency symbol '€' at the end.-->
          <field name="price_with_currency" size="" type="VARCHAR">
            <gen_PrePostfix>
              <postfix>€</postfix>
              <gen_LongNumber>
                <min>1</min>
                <max>1000</max>
              </gen_LongNumber>
            </gen_PrePostfix>
          </field>
          </table>
    </schema>
    
    Output for Price with Currency Symbol (€)
    758€
    778€
    284€
    908€
    86€
    185€
    898€
    150€
    90€
    845€
  3. HTML Span Elements

    Generates random strings and encloses them in span tags

    Schema config for HTML Span Elements
    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <!--
    /*******************************************************************************
    * Copyright (c) 2013, bankmark and/or its affiliates. All rights reserved.
    * bankmark UG PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
    ******************************************************************************/
    --><schema xmlns:doc="http://bankmark.de/pdgf/doc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="demo" xsi:noNamespaceSchemaLocation="structure/pdgfSchema.xsd">
      <!-- All data is derived from this starting seed.
           If this seed is the same, the generated data will the same on each
           computer/node/platform.
           Change this seed to generate a different data set.-->
      <seed>1234567890L</seed>
    
      <rng name="PdgfDefaultRandom"/>
    
      <!--Default Scale factor for all tables -->
      <property name="SF" type="double">1</property>
    
      <table name="PrePostfix">
        <!-- if tables should scale with -SF command line argument.
             Specify your scaling formula here: -->
        <size>10 * ${SF}</size>
    
        <!--HTML Span Elements-->
          <!--Generates random strings and encloses them in span tags-->
          <field name="html_span_element" size="" type="VARCHAR">
            <gen_PrePostfix>
              <prefix><![CDATA[<span>]]></prefix>
              <postfix><![CDATA[</span>]]></postfix>
              <gen_RandomString>
                <min>4</min>
                <max>10</max>
              </gen_RandomString>
            </gen_PrePostfix>
          </field>
          </table>
    </schema>
    
    Output for HTML Span Elements
    <span>cs8x</span>
    <span>cAvN8Te0</span>
    <span>oDtM4k</span>
    <span>L10XaQ7R</span>
    <span>7Rtby0amC</span>
    <span>jL1KR</span>
    <span>df9fnQDoo</span>
    <span>WGkm</span>
    <span>nPNS1</span>
    <span>4Mc12</span>
2.7-83fb0 | 2020-04-22