Wenn Sie Application Integration zum ersten Mal in Ihrem Google Cloud-Projekt einrichten, wird standardmäßig eine nicht veröffentlichte Beispielintegration mit dem Namen ExampleIntegration-EcomOrderProcessing erstellt.
Beispielintegration ansehen
So rufen Sie die Beispielintegration auf:
Rufen Sie in der Google Cloud Console die Seite Application Integration auf.
Hier wird die JSON-Eingabevariable order_request extrahiert und mithilfe der Zuordnungsfunktion FOR_EACH werden alle Bestellartikel durchlaufen, um den Gesamtwert des Bestellpreises zu berechnen.
Der Wert des Gesamtbestellpreises wird berechnet, indem der Artikel quantity mit dem price_per_item multipliziert wird. Dazu werden die Mapping-Funktionen GET_PROPERTY und MULTIPLY verwendet.
Der endgültige Wert wird dann in den Datentyp „double“ konvertiert und in der Ausgabevariablen total_order_value gespeichert.
Zum Testen dieser Beispielintegration können Sie mit Ihrer E-Mail-Adresse den erfolgreichen Abschluss der Integration bestätigen.
E-Mail-Anfrage zur Genehmigung an einen oder mehrere Integrationsnutzer senden. Die E-Mail enthält einen Link zur Integration, über den die Nutzer die Anfrage manuell genehmigen oder ablehnen können.
Hier wird die JSON-Eingabevariable order_request extrahiert und alle Bestellpositionen mit externen Anbietern werden mithilfe der Zuordnungsfunktion FILTER gefiltert.
Die gefilterten Werte werden dann in der Ausgabevariablen filtered_external_items gespeichert.
Durchläuft die Variable filtered_external_items und ruft die Subintegration für jedes Element im Array auf. Außerdem wird die Antwort jeder Ausführung in rest_call_response_status erfasst, wobei jedes Element des Arrays die Antwort aus einer bestimmten Ausführung enthält.
Basis-URL des Endpunkts: https://mocktarget.apigee.net/echo
HTTP-Methode:POST
Anfragetext: sub_integration_input
Führt einen REST-Aufruf an https://mocktarget.apigee.net/echo aus.
Beispielintegration veröffentlichen und testen
Klicken Sie in der Symbolleiste des Integrationseditors auf Veröffentlichen, um die Integration zu veröffentlichen.
Nach der Veröffentlichung Ihrer Integration können Sie die Ausführungslogs der veröffentlichten Integration aufrufen und prüfen. Klicken Sie auf Ausführungsprotokolle für diese Integration ansehen, um die Protokolle aufzurufen. Die Seite Ausführungslogs wird angezeigt.
Im Integrationseditor testen
So testen Sie die Beispielintegration:
Klicken Sie in der Symbolleiste des Integrationseditors auf Testen und wählen Sie dann OrderProcessAPITrigger aus.
Der Bereich Integration testen wird angezeigt.
Sie werden aufgefordert, die Eingabevariable orders_request zu bearbeiten. Für diesen Test können Sie den Wert für quantity auf 240 aktualisieren. Die Eingabevariable „update orders_request“ sollte in etwa so aussehen:
Da die aktualisierte Menge von orders_request über 200 liegt, sendet die Beispielintegration eine E-Mail mit einer Genehmigungsanfrage an die E-Mail-Adresse, die im Feld Empfänger der Genehmigungsaufgabe angegeben ist. Der Vorgang für die Integrationsanfrage wird abgeschlossen, sobald die Genehmigung eingegangen ist.
So prüfen Sie die Ausführungsprotokolle und sehen sich den Status und die Nutzlast der jeweiligen Integration an:
Klicken Sie im Integrationseditor auf Ausführungsprotokolle für diese Integration ansehen. Die Seite Ausführungslogs wird angezeigt.
Auf der Seite Ausführungslogs können Sie Details zu jedem Versuch anzeigen, eine Integration auszuführen.
Jeder Eintrag enthält Details für den Ausführungsversuch. Beispiele:
Name der Integration
Ausführungs-ID
Status
Beginn
Dauer
Integrationsversion
Trigger-ID
Klicken Sie neben der ausgeführten Integration auf den Erweiterungspfeil (>), um eine erweiterte Liste von Aufgaben und Variablen in der Integration aufzurufen. Außerdem werden der Aufgabenstatus und die Nutzlasten von Variablen angezeigt.
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Schwer verständlich","hardToUnderstand","thumb-down"],["Informationen oder Beispielcode falsch","incorrectInformationOrSampleCode","thumb-down"],["Benötigte Informationen/Beispiele nicht gefunden","missingTheInformationSamplesINeed","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 2025-08-25 (UTC)."],[[["\u003cp\u003eApplication Integration provides a default, unpublished sample integration called \u003cstrong\u003eExampleIntegration-EcomOrderProcessing\u003c/strong\u003e to help users understand its triggers, tasks, and concepts.\u003c/p\u003e\n"],["\u003cp\u003eThe sample integration simulates an e-commerce order processing scenario, including receiving order requests, calculating total order value, checking for value thresholds, and handling external vendor items.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003cstrong\u003eExampleIntegration-EcomOrderProcessing\u003c/strong\u003e utilizes various components, such as an API trigger, data mapping tasks, edge conditions, an approval task, and a for-each loop task, all detailed in the included documentation.\u003c/p\u003e\n"],["\u003cp\u003eUsers can test the sample integration directly from the integration editor by modifying the \u003ccode\u003eorders_request\u003c/code\u003e input variable or by sending requests using a REST API call with custom parameters.\u003c/p\u003e\n"],["\u003cp\u003eExecution logs for the sample integration can be viewed to monitor the status of each run, including details on the various tasks, variables, and payloads.\u003c/p\u003e\n"]]],[],null,["# Try the sample integration\n\nSee the [supported connectors](/integration-connectors/docs/connector-reference-overview) for Application Integration.\n\nTry the sample integration\n==========================\n\n\nWhile setting up Application Integration in your Google Cloud project for the first time, Application Integration, by default, creates an *unpublished* sample integration named **ExampleIntegration-EcomOrderProcessing**.\n\nView sample integration\n-----------------------\n\n\nTo view the sample integtration, do the following:\n\n1. In the Google Cloud console, go to the **Application Integration** page.\n\n [Go to Application Integration](https://console.cloud.google.com/integrations)\n2. Click **Integrations** from the left navigation menu to open the **Integrations** page.\n3. Click the integration named **ExampleIntegration-EcomOrderProcessing** .\n\n\n The sample integration opens in the [integration editor](/application-integration/docs/integrations-ui-layout) similar to the following layout:\n\n\n| **Tip:** If you are unable to find or open the sample integration, you can download the JSON version of the integration and upload it back using the integration editor. For more information, see [E-commerce sample integration](/application-integration/docs/samples/ecom-order-processing).\n\nE-commerce sample integration\n-----------------------------\n\n\nYou can use this sample integration to get a hands-on experience of the various [triggers](/application-integration/docs/triggers), [tasks](/application-integration/docs/tasks), and [concepts](/application-integration/docs/concepts) of Application Integration.\n\n\nThe sample integration illustrates a basic e-commerce back-end scenario implementing the following order processing operation:\n\n1. Receive the following order request payload from an API endpoint: \n\n ```json\n {\n \"order_no\": \"12345\",\n \"buyer_id\": \"raambo\",\n \"line_items\": [\n {\n \"line\": 1,\n \"sku\": \"tr100\",\n \"vendor\": \"Internal\",\n \"quantity\": 1,\n \"price_per_unit\": 10\n },\n {\n \"line\": 2,\n \"sku\": \"tbz\",\n \"vendor\": \"External\",\n \"quantity\": 24.0,\n \"price_per_unit\": 1\n }\n ]\n }\n ```\n2. Extract the order payload and calculate the total order value.\n3. Check if the total order value is greater than or equal to $100. If yes, then get an additional approval to continue.\n4. Check if any of the order items have an *external* vendor. If yes, then send the details to the vendor using a REST API call.\n5. Send out the order response with the total order value, filtered external vendor items and their respective HTTP response status.\n\n\nThe following table lists all the triggers, tasks, and edge conditions used in **ExampleIntegration-EcomOrderProcessing**:\n\nPublish and test the sample integration\n---------------------------------------\n\nTo publish the integration click **Publish** in the integration editor toolbar.\n\nUpon successfully publishing your integration, you can view and inspect the [execution logs](/application-integration/docs/integration-execution-logs) of the published integration. To view logs, click **View execution logs for this integration** . The **Execution Logs** page appears.\n\n### Test from the integration editor\n\nDo the following to test the sample integration:\n\n1. Click **Test** in the integration editor toolbar, and then select **OrderProcessAPITrigger** .\n\n The **Test Integration** pane appears.\n2. You are prompted to edit the `orders_request` input variable. For the purpose of this test, you can update the `quantity` value to `240`. The update `orders_request` input variable should look similar to the following: \n\n ```json\n {\n \"order_no\": \"12345\",\n \"buyer_id\": \"raambo\",\n \"line_items\": [\n {\n \"line\": 1,\n \"sku\": \"tr100\",\n \"vendor\": \"Internal\",\n \"quantity\": 1,\n \"price_per_unit\": 10\n },\n {\n \"line\": 2,\n \"sku\": \"tbz\",\n \"vendor\": \"External\",\n \"quantity\": 240,\n \"price_per_unit\": 1\n }\n ]\n }\n \n ```\n3. Click **Test integration**.\n\n\nSince the updated `orders_request` quantity is greater than **200** , the sample integration sends an approval request email to the email address specified in the **Recipients** field of the [Approval task](#approval). The integration order operation will successfully complete once the approval is received.\n\nFor more information about testing, see [Test and publish integrations](/application-integration/docs/test-publish-integrations).\n\nDo the following to inspect the execution logs and to view the status\nand payload of the given integration:\n\n1. In the integration editor, click **View execution logs for this integration** . The **Execution Logs** page appears.\n2. On the **Execution Logs** page, you can view details about each attempt to run an integration. Each entry includes details for the execution attempt, including:\n - Integration name\n - Execution ID\n - Status\n - Start time\n - Duration\n - Integration Version\n - Trigger ID\n3. Click the expander arrow (**\\\u003e**) next to the executed integration to view an expanded list of tasks and variables in the integration, along with task status and variable payloads.\n\n### Test using a REST API call\n\n| **Note:** The following test cases use `curl`, which typically comes pre-installed for Linux and macOS operating systems. If you don't have `curl`, you can download it from the `curl` [releases and downloads page](https://curl.haxx.se/download.html).\n\n#### Test case 1: Send request with default inputs\n\n```\n curl -X POST -H \"Content-Type: application/json\" -d '{\"trigger_id\":\"api_trigger/ecom-order-processing_API_1\"}' 'https://integrations.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/integrations/INTEGRATION_NAME:execute' -H \"Authorization: Bearer $(gcloud auth print-access-token)\"\n```\n\n#### Test case 2: Send request with custom inputs\n\n```\n curl -X POST -H \"Content-Type: application/json\" -d '{ \"triggerId\": \"api_trigger/ecom-order-processing_API_1\", \"inputParameters\": { \"orders_request\": { \"jsonValue\": \"{\\n \\\"order_no\\\": \\\"12345\\\",\\n \\\"buyer_id\\\": \\\"raambo\\\",\\n \\\"line_items\\\": [{\\n \\\"line\\\": 1.0,\\n \\\"sku\\\": \\\"tr100\\\",\\n \\\"vendor\\\": \\\"Internal\\\",\\n \\\"quantity\\\": 1.0,\\n \\\"price_per_unit\\\": 10.0\\n }, {\\n \\\"line\\\": 2.0,\\n \\\"sku\\\": \\\"tbz\\\",\\n \\\"vendor\\\": \\\"External\\\",\\n \\\"quantity\\\": 24.0,\\n \\\"price_per_unit\\\": 2.0\\n }]\\n}\" } } }' 'https://integrations.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/integrations/INTEGRATION_NAME:execute' -H \"Authorization: Bearer $(gcloud auth print-access-token)\"\n```\n\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: The ID of your Google Cloud project.\n- \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e: The integration location. See [Application Integration locations](/application-integration/docs/locations).\n- \u003cvar translate=\"no\"\u003eINTEGRATION_NAME\u003c/var\u003e: Name of the integration.\n\n#### Test output\n\n\nThe API returns the integration execution response containing all the integration output variable values.\n\nQuotas and limits\n-----------------\n\nFor information about quotas and limits, see [Quotas and limits](/application-integration/docs/quotas)."]]