Files
sim-autostore/XML_API_REFERENCE.md
René Walther 4ec499dd99 Implement all 20 missing AutoStore XML API commands
- Extended database models (Bin, Port, Task, TaskGroup) with all required fields
- Added 15+ new CRUD operations for comprehensive data management
- Implemented all 20 XML commands from PARS_AUTOSTORE.pkb:
  * Bin Information: GetBinInfo, GetBinLoc, GetBinState
  * Bin Content: SetBinContentCode, updatebin (legacy support)
  * Bin Lifecycle: CreateBin, DeleteBin, PrepareBin
  * Bin Operations: OpenBin, CloseBin
  * Port Management: openport, closeport, insertbin, removebin
  * Task/Taskgroup: create_taskgroup, update_taskgroup, cancel_taskgroup, add_task, cancel_task, gettaskinfo
- All commands are case-insensitive and support flexible parameter names
- Enhanced Swagger/OpenAPI documentation with detailed examples
- Added comprehensive XML_API_REFERENCE.md with all command examples
- Added IMPLEMENTATION_SUMMARY.md with technical overview
- Full compatibility with PL/SQL PARS_AUTOSTORE package
- All commands available via /api and /api/json endpoints

Coverage: 20/20 commands (100%)
2025-11-07 07:04:11 +01:00

14 KiB

AutoStore Simulator - XML API Reference

Vollständige Referenz aller unterstützten XML-Befehle für die AutoStore Task Interface Simulation.

Übersicht

Der Simulator unterstützt alle Befehle aus dem PARS_AUTOSTORE.pkb PL/SQL-Package. Alle Befehle sind case-insensitive und können über folgende Endpoints aufgerufen werden:

  • POST /api - Direkter XML-Request
  • POST /api/json - JSON-Wrapper für Swagger-Testing

1. Bin Information Commands

GetBinInfo

Ruft Informationen über einen Bin ab (Content Code, etc.).

XML Request:

<AutoStore>
    <GetBinInfo>
        <Bin>A100000</Bin>
    </GetBinInfo>
</AutoStore>

XML Response:

<AutoStore>
    <GetBinInfo>
        <Bin>A100000</Bin>
        <ContentCode>42</ContentCode>
    </GetBinInfo>
</AutoStore>

GetBinLoc

Ruft die physische Position eines Bins im Grid ab.

XML Request:

<AutoStore>
    <getbinloc>
        <params>
            <bin_id>A100000</bin_id>
        </params>
    </getbinloc>
</AutoStore>

XML Response:

<response>
    <params>
        <bin_id>A100000</bin_id>
        <location>unknown</location>
        <state>available</state>
    </params>
</response>

Range Query:

<AutoStore>
    <getbinloc>
        <params>
            <min_bin_id>A100000</min_bin_id>
            <max_bin_id>A100010</max_bin_id>
        </params>
    </getbinloc>
</AutoStore>

GetBinState

Ruft den aktuellen State eines Bins ab.

XML Request:

<AutoStore>
    <getbinstate>
        <params>
            <bin_id>A100000</bin_id>
        </params>
    </getbinstate>
</AutoStore>

XML Response:

<response>
    <params>
        <bin_id>A100000</bin_id>
        <state>available</state>
        <content_code>0</content_code>
    </params>
</response>

Mögliche States:

  • available - Verfügbar im Grid
  • in_transit - Unterwegs zum Port
  • at_port - Am Port
  • reserved - Für Operation reserviert

2. Bin Content Management

SetBinContentCode

Setzt den Content Code eines Bins.

XML Request:

<AutoStore>
    <SetBinContentCode>
        <Bin>A100000</Bin>
        <ContentCode>42</ContentCode>
    </SetBinContentCode>
</AutoStore>

XML Response:

<AutoStore>
    <SetBinContentCode>
        <Bin>A100000</Bin>
        <ContentCode>42</ContentCode>
        <Success>True</Success>
    </SetBinContentCode>
</AutoStore>

updatebin (Legacy Format)

Alternative Format zum Aktualisieren des Content Codes (kompatibel mit bestehendem System).

XML Request:

<AutoStore>
    <updatebin>
        <params>
            <bin_id>A100000</bin_id>
            <content>81</content>
        </params>
    </updatebin>
</AutoStore>

XML Response:

<AutoStore>
    <updatebin>
        <params>
            <bin_id>A100000</bin_id>
            <content>81</content>
            <success>True</success>
        </params>
    </updatebin>
</AutoStore>

3. Bin Lifecycle Commands

CreateBin

Erstellt einen neuen Bin im System.

XML Request:

<AutoStore>
    <createbin>
        <params>
            <bin_id>A100999</bin_id>
            <bin_type>1</bin_type>
        </params>
    </createbin>
</AutoStore>

XML Response:

<response>
    <params>
        <bin_id>A100999</bin_id>
        <bin_type>1</bin_type>
        <success>True</success>
    </params>
</response>

Bin Types:

  • 1 - Ganzer Bin (Standard)
  • 2 - Halber Bin längs
  • 3 - Halber Bin quer
  • 4 - Viertel Bin
  • 8 - Achtel Bin

DeleteBin

Löscht einen Bin aus dem System.

XML Request:

<AutoStore>
    <deletebin>
        <params>
            <bin_id>A100999</bin_id>
        </params>
    </deletebin>
</AutoStore>

XML Response:

<response>
    <params>
        <bin_id>A100999</bin_id>
        <success>True</success>
    </params>
</response>

PrepareBin

Bereitet mehrere Bins für Operationen vor (setzt State auf "reserved").

XML Request:

<AutoStore>
    <preparebin>
        <params>
            <bins>
                <bin_id>A100000</bin_id>
                <bin_id>A100001</bin_id>
                <bin_id>A100002</bin_id>
            </bins>
        </params>
    </preparebin>
</AutoStore>

XML Response:

<response>
    <params>
        <bins_prepared>3</bins_prepared>
        <success>True</success>
    </params>
</response>

4. Bin Port Operations

OpenBin (by Bin ID)

Fordert einen spezifischen Bin an.

XML Request:

<AutoStore>
    <OpenBin>
        <Bin>A100000</Bin>
    </OpenBin>
</AutoStore>

XML Response:

<response>
    <params>
        <bin_id>A100000</bin_id>
        <success>True</success>
    </params>
</response>

OpenBin (by Port ID)

Fordert den nächsten verfügbaren leeren Bin für einen Port an (Wareneingang).

XML Request:

<AutoStore>
    <OpenBin>
        <Port>1</Port>
    </OpenBin>
</AutoStore>

XML Response:

<response>
    <params>
        <bin_id>A100005</bin_id>
        <port_id>1</port_id>
        <success>True</success>
    </params>
</response>

Note: Gibt automatisch einen Bin mit content_code = 0 zurück.

CloseBin

Schließt einen Bin und sendet ihn zurück ins Grid.

XML Request:

<AutoStore>
    <CloseBin>
        <Bin>A100000</Bin>
    </CloseBin>
</AutoStore>

XML Response:

<AutoStore>
    <CloseBin>
        <Bin>A100000</Bin>
        <Success>True</Success>
    </CloseBin>
</AutoStore>

5. Port Management Commands

openport

Öffnet einen Port mit optionalen Content/Category Filtern.

XML Request (ohne Filter):

<AutoStore>
    <openport>
        <params>
            <port_id>1</port_id>
        </params>
    </openport>
</AutoStore>

XML Request (mit Content Filter):

<AutoStore>
    <openport>
        <params>
            <port_id>1</port_id>
            <select>
                <content>0</content>
                <content>1</content>
            </select>
        </params>
    </openport>
</AutoStore>

XML Request (mit Category Filter):

<AutoStore>
    <openport>
        <params>
            <port_id>1</port_id>
            <select>
                <category>1</category>
                <category>2</category>
            </select>
        </params>
    </openport>
</AutoStore>

XML Response:

<response>
    <params>
        <port_id>1</port_id>
        <success>True</success>
    </params>
</response>

closeport

Schließt einen Port.

XML Request:

<AutoStore>
    <closeport>
        <params>
            <port_id>1</port_id>
            <suspend_taskgroup>false</suspend_taskgroup>
        </params>
    </closeport>
</AutoStore>

XML Response:

<response>
    <params>
        <port_id>1</port_id>
        <message>Port closed successfully</message>
        <success>True</success>
    </params>
</response>

insertbin

Fügt einen externen Bin am Port ein.

XML Request:

<AutoStore>
    <insertbin>
        <params>
            <port_id>1</port_id>
            <bin_id>A100000</bin_id>
            <content>0</content>
            <bin_type>1</bin_type>
        </params>
    </insertbin>
</AutoStore>

XML Response:

<response>
    <params>
        <port_id>1</port_id>
        <bin_id>A100000</bin_id>
        <success>True</success>
    </params>
</response>

removebin

Entfernt einen Bin vom Port.

XML Request:

<AutoStore>
    <removebin>
        <params>
            <port_id>1</port_id>
            <bin_id>A100000</bin_id>
            <task_id>T001</task_id>
            <taskcomplete>true</taskcomplete>
        </params>
    </removebin>
</AutoStore>

XML Response:

<response>
    <params>
        <port_id>1</port_id>
        <bin_id>A100000</bin_id>
        <success>True</success>
    </params>
</response>

6. Task/Taskgroup Management

create_taskgroup

Erstellt eine neue Taskgroup mit mehreren Tasks (Kommissionieraufträge).

XML Request:

<AutoStore>
    <create_taskgroup>
        <params>
            <taskgroup_id>TG001</taskgroup_id>
            <shipment>SHIP12345</shipment>
            <category>1</category>
            <priority>5</priority>
            <req_time>2024-11-07 10:00</req_time>
            <suspended>false</suspended>
            <tasks>
                <task>
                    <task_id>T001</task_id>
                    <bin_id>A100001</bin_id>
                    <item>1</item>
                    <order>1</order>
                    <estpicktime>5</estpicktime>
                </task>
                <task>
                    <task_id>T002</task_id>
                    <bin_id>A100002</bin_id>
                    <item>1</item>
                    <order>2</order>
                    <estpicktime>5</estpicktime>
                </task>
            </tasks>
        </params>
    </create_taskgroup>
</AutoStore>

XML Response:

<response>
    <params>
        <taskgroup_id>TG001</taskgroup_id>
        <tasks_created>2</tasks_created>
        <success>True</success>
    </params>
</response>

Parameter Erklärung:

  • taskgroup_id - Eindeutige ID der Taskgroup (entspricht zeilenrlogikopf)
  • shipment - Optional: Lieferungs-/Sendungs-ID
  • category - Kategorie für Priorisierung (1-n)
  • priority - Priorität (höher = wichtiger)
  • req_time - Gewünschte Bearbeitungszeit
  • suspended - true = Taskgroup pausiert
  • task_id - Eindeutige Task-ID (entspricht zeilenr in logistik)
  • bin_id - Bin aus dem kommissioniert werden soll
  • item - Item-Nummer in der Sequenz
  • order - Reihenfolge des Tasks
  • estpicktime - Geschätzte Pick-Zeit in Sekunden

update_taskgroup

Aktualisiert Parameter einer bestehenden Taskgroup.

XML Request:

<AutoStore>
    <update_taskgroup>
        <params>
            <taskgroup_id>TG001</taskgroup_id>
            <priority>10</priority>
            <category>2</category>
            <suspended>false</suspended>
        </params>
    </update_taskgroup>
</AutoStore>

XML Response:

<response>
    <params>
        <taskgroup_id>TG001</taskgroup_id>
        <success>True</success>
    </params>
</response>

cancel_taskgroup

Bricht eine Taskgroup und alle zugehörigen Tasks ab.

XML Request:

<AutoStore>
    <cancel_taskgroup>
        <params>
            <taskgroup_id>TG001</taskgroup_id>
        </params>
    </cancel_taskgroup>
</AutoStore>

XML Response:

<response>
    <params>
        <taskgroup_id>TG001</taskgroup_id>
        <message>Taskgroup cancelled</message>
        <success>True</success>
    </params>
</response>

add_task

Fügt einen neuen Task zu einer bestehenden Taskgroup hinzu.

XML Request:

<AutoStore>
    <add_task>
        <params>
            <taskgroup_id>TG001</taskgroup_id>
            <task>
                <task_id>T003</task_id>
                <bin_id>A100003</bin_id>
                <item>1</item>
                <order>3</order>
                <estpicktime>5</estpicktime>
            </task>
        </params>
    </add_task>
</AutoStore>

XML Response:

<response>
    <params>
        <taskgroup_id>TG001</taskgroup_id>
        <task_id>T003</task_id>
        <success>True</success>
    </params>
</response>

cancel_task

Bricht einen einzelnen Task ab.

XML Request:

<AutoStore>
    <cancel_task>
        <params>
            <task_id>T001</task_id>
        </params>
    </cancel_task>
</AutoStore>

XML Response:

<response>
    <params>
        <task_id>T001</task_id>
        <message>Task cancelled</message>
        <success>True</success>
    </params>
</response>

gettaskinfo

Ruft detaillierte Informationen über Taskgroups und Tasks ab.

XML Request (by Taskgroup ID):

<AutoStore>
    <gettaskinfo>
        <params>
            <taskgroup_id>TG001</taskgroup_id>
        </params>
    </gettaskinfo>
</AutoStore>

XML Request (by Task ID):

<AutoStore>
    <gettaskinfo>
        <params>
            <task_id>T001</task_id>
        </params>
    </gettaskinfo>
</AutoStore>

XML Request (Range Query):

<AutoStore>
    <gettaskinfo>
        <params>
            <min_taskgroup_id>TG001</min_taskgroup_id>
            <max_taskgroup_id>TG010</max_taskgroup_id>
        </params>
    </gettaskinfo>
</AutoStore>

XML Response:

<response>
    <params>
        <taskgroup_id>TG001</taskgroup_id>
        <status>queued</status>
        <task_count>2</task_count>
        <tasks>
            <task_id>T001</task_id>
            <bin_id>A100001</bin_id>
            <status>queued</status>
            <task_id>T002</task_id>
            <bin_id>A100002</bin_id>
            <status>queued</status>
        </tasks>
        <success>True</success>
    </params>
</response>

Error Handling

Bei Fehlern gibt der Simulator folgende Antwort zurück:

Error Response:

<AutoStore>
    <Error>
        <Code>RequestError</Code>
        <Description>Bin not found: A999999</Description>
    </Error>
</AutoStore>

Testing in Swagger UI

  1. Navigiere zu http://localhost:8000/docs
  2. Öffne den POST /api/json Endpoint
  3. Klicke "Try it out"
  4. Füge deinen XML-Command in den xml_content Feld ein
  5. Klicke "Execute"

Example JSON Body:

{
  "xml_content": "<AutoStore><GetBinInfo><Bin>A100000</Bin></GetBinInfo></AutoStore>"
}

Case-Insensitivity

Alle Commands und viele Parameter sind case-insensitive:

✅ Alle funktionieren:

  • <OpenBin> = <openbin> = <OPENBIN>
  • <Bin> = <bin> = <bin_id>
  • <Port> = <port> = <port_id>

Compatibility Notes

Der Simulator ist kompatibel mit:

  • PL/SQL Package PARS_AUTOSTORE.pkb
  • AutoStore Task Interface Specification
  • Tosca.connect BOBJ Handlers (pick, stock, article)
  • Legacy updatebin Format für bestehende Systeme

Admin REST Endpoints

Zusätzlich zu den XML Commands gibt es REST Endpoints für Administration:

  • POST /bins/ - Einzelnen Bin erstellen
  • GET /bins/ - Alle Bins auflisten
  • GET /bins/{bin_id} - Einzelnen Bin abrufen
  • PUT /bins/{bin_id} - Bin Content Code aktualisieren
  • DELETE /bins/{bin_id} - Bin löschen
  • POST /bins/generate - Mehrere Bins generieren
  • POST /ports/ - Port erstellen
  • GET /ports/ - Alle Ports auflisten
  • GET /ports/{port_id} - Einzelnen Port abrufen

Siehe /docs für vollständige REST API Dokumentation.