How to make an adapter






nieuwe template:

<?xml version="1.0" encoding="UTF-8"?>
<!-- DO NOT USE A MODULE ELEMENT, MAKE SUBADAPTERS IN ANOTHER FILE -->
<adapter description="This adapter does something"><!-- USE the description to tell what your adapter does -->
    <documentation><!-- Define your flows in the adapter/documentation -->
        <flows>
            <flow>
                <id>1</id><!-- Create an ID here -->
                <description></description><!-- Describe the flow -->
                <state>success</state><!-- give state 'success' or 'error' -->
            </flow>
            <flow>
                <id>2</id><!-- Create an ID here -->
                <description></description><!-- Describe the flow -->
                <state>error</state><!-- give state 'success' or 'error' -->
            </flow>
        </flows>
    </documentation>
    <receiver>
        <documentation><!-- Add your trigger as a first step of your flow(s) in adapter/receiver/documentation -->
            <flows>
                <flow>
                    <id>1</id><!-- Give one of the ID's given in adapter/documentation/flows/flow -->
                    <step>This flow listens to a java call</step><!-- Describe what the step does USE ONLY 1 STEP IN THE RECEIVER PER ID-->
                </flow>
                <flow>
                    <id>2</id><!-- Give one of the ID's given in adapter/documentation/flows/flow -->
                    <step>This flow listens to a java call as well</step><!-- Describe what the step does USE ONLY 1 STEP IN THE RECEIVER PER ID-->
                </flow>
            </flows>
        </documentation>
        <listener/>
    </receiver>
    <pipeline>
        <exits>
            <exit/>
        </exits>
        <documentation><!-- Define your steps preferably before you make pipes. You can place pipes between documentation elements; see below -->
            <flows>
                <flow>
                    <id>1</id><!-- Give one of the ID's given in adapter/documentation/flows/flow -->
                    <id>2</id><!-- Give one of the ID's given in adapter/documentation/flows/flow -->
                    <step>Validates the incoming message</step><!-- Describe what the step does -->
                </flow>
            </flows>
        </documentation>
        <pipe name="Write_a_pipe_name_with_underscores_so_you_can_double_click_the_whole_name">
            <forward name="success" path="EXIT"/><!-- Forward example to copy/paste -->
        </pipe>
        <pipe/>
    </pipeline>
</adapter>

oude template:

<?xml version="1.0" encoding="UTF-8"?>
<!-- DO NOT USE A MODULE ELEMENT, MAKE SUBADAPTERS IN ANOTHER FILE -->
<adapter description="This adapter does something"><!-- USE the description to tell what your adapter does -->
    <receiver>
        <listener/>
    </receiver>
    <pipeline>
        <exits>
            <exit/>
        </exits>
        <pipe name="Write_a_pipe_name_with_underscores_so_you_can_double_click_the_whole_name">
            <forward name="success" path="EXIT"/><!-- Forward example to copy/paste -->
        </pipe>
        <pipe/>
    </pipeline>
</adapter>

Dit is hoe we normaal een adapter maakten, maar nu is er een manier om dit slimmer aan te pakken.

Hoe pak je dat nou aan?

Volg deze stappen en het gaat als vanzelf:

  1. Kopieer de nieuwe template. Dit is de basis van je adapter.
  2. Pas de beschrijvingen binnen de documentatie tags aan.
  3. Maak per extra stap in je pipeline nieuwe tags aan (mits dat nodig is voor jou adapter).
  4. Als jou adapter meerdere flows heeft, maak die dan nu aan.
  5. Als je alle documentatie hebt gemaakt over hoe je adapter eruit  moet gaan zien(flows met daarin pipes) dan kun je nu beginnen met het bouwen van de adapter.