Cuando configuras Application Integration por primera vez en tu proyecto de Google Cloud, Application Integration crea de forma predeterminada una integración de ejemplo sin publicar llamada ExampleIntegration-EcomOrderProcessing.
Ver integración de ejemplo
Para ver la integración de ejemplo, siga estos pasos:
En la consola de Google Cloud, ve a la página Application Integration (Integración de aplicaciones).
En el menú de navegación de la izquierda, haga clic en Integraciones para abrir la página Integraciones.
Haga clic en la integración llamada ExampleIntegration-EcomOrderProcessing.
La integración de ejemplo se abre en el editor de integración, con un diseño similar al siguiente:
Integración de ejemplo de comercio electrónico
Puedes usar esta integración de ejemplo para familiarizarte con los distintos activadores, tareas y conceptos de Application Integration.
La integración de ejemplo ilustra un escenario básico de backend de comercio electrónico que implementa la siguiente operación de procesamiento de pedidos:
Recibe la siguiente carga útil de solicitud de pedido de un endpoint de API:
Extrae la carga útil del pedido y calcula el valor total del pedido.
Comprueba si el valor total del pedido es igual o superior a 100 USD. Si es así, obtén una aprobación adicional para continuar.
Comprueba si alguno de los artículos del pedido tiene un proveedor externo. Si es así, envíe los detalles al proveedor mediante una llamada a la API REST.
Envía la respuesta del pedido con el valor total del pedido, los artículos de proveedores externos filtrados y sus respectivos estados de respuesta HTTP.
En la siguiente tabla se enumeran todos los activadores, las tareas y las condiciones extremas que se usan en ExampleIntegration-EcomOrderProcessing:
Extrae la variable de entrada JSON order_request e itera por todos los elementos del pedido mediante la función de asignación FOR_EACH para calcular el valor del precio total del pedido.
El valor del precio total del pedido se calcula multiplicando el quantity del artículo por el price_per_item mediante las funciones de asignación GET_PROPERTY y MULTIPLY.
El valor final se convierte en un tipo de datos doble y se almacena en la variable de salida total_order_value.
Para probar esta integración de ejemplo, puedes usar tu correo para confirmar que se ha completado correctamente.
Envía un correo de solicitud de aprobación a uno o varios usuarios de la integración. El correo incluye un enlace a la integración donde los usuarios pueden aprobar o rechazar manualmente la solicitud.
Extrae la variable de entrada JSON order_request y filtra todos los artículos del pedido con proveedores externos mediante la función de asignación FILTER.
Los valores filtrados se almacenan en la variable de salida filtered_external_items.
ID de activador de API:api_trigger/ecom-order-processing_API_2
Nombre de la integración: ExampleIntegration-EcomOrderProcessing
Itera sobre la variable filtered_external_items y llama a la subintegración de cada elemento de la matriz. También recopila la respuesta de cada ejecución en rest_call_response_status, donde cada elemento de la matriz tiene la respuesta de una ejecución concreta.
URL base del endpoint: https://mocktarget.apigee.net/echo
Método HTTP:POST
Cuerpo de la solicitud: sub_integration_input
Hace una llamada REST a https://mocktarget.apigee.net/echo.
Publicar y probar la integración de muestra
Para publicar la integración, haga clic en Publicar en la barra de herramientas del editor de integraciones.
Una vez que hayas publicado tu integración correctamente, podrás ver e inspeccionar los registros de ejecución de la integración publicada. Para ver los registros, haz clic en Ver registros de ejecución de esta integración. Se abrirá la página Registros de ejecución.
Hacer pruebas desde el editor de integración
Para probar la integración de muestra, haz lo siguiente:
En la barra de herramientas del editor de integración, haga clic en Probar y, a continuación, seleccione OrderProcessAPITrigger.
Aparecerá el panel Integración de prueba.
Se te pedirá que edites la variable de entrada orders_request. Para esta prueba, puedes cambiar el valor de quantity a 240. La variable de entrada orders_request de la actualización debería ser similar a la siguiente:
Haz clic en Test integration (Probar integración).
Como la cantidad actualizada de orders_request es superior a 200, la integración de ejemplo envía un correo de solicitud de aprobación a la dirección de correo especificada en el campo Destinatarios de la tarea de aprobación. La operación de pedido de integración se completará correctamente una vez que se reciba la aprobación.
Para inspeccionar los registros de ejecución y ver el estado y la carga útil de la integración en cuestión, siga estos pasos:
En el editor de integraciones, haz clic en Ver registros de ejecución de esta integración. Se abrirá la página Registros de ejecución.
En la página Registros de ejecución, puedes ver los detalles de cada intento de ejecutar una integración.
Cada entrada incluye detalles sobre el intento de ejecución, como los siguientes:
Nombre de la integración
ID de ejecución
Estado
Hora de inicio
Duración
Versión de integración
ID de activador
Haga clic en la flecha de expansión (>) situada junto a la integración ejecutada para ver una lista ampliada de tareas y variables de la integración, junto con el estado de las tareas y las cargas útiles de las variables.
Hacer pruebas con una llamada a la API REST
Caso de prueba 1: Enviar solicitud con entradas predeterminadas
[[["Es fácil de entender","easyToUnderstand","thumb-up"],["Me ofreció una solución al problema","solvedMyProblem","thumb-up"],["Otro","otherUp","thumb-up"]],[["Es difícil de entender","hardToUnderstand","thumb-down"],["La información o el código de muestra no son correctos","incorrectInformationOrSampleCode","thumb-down"],["Me faltan las muestras o la información que necesito","missingTheInformationSamplesINeed","thumb-down"],["Problema de traducción","translationIssue","thumb-down"],["Otro","otherDown","thumb-down"]],["Última actualización: 2025-09-11 (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)."]]