Skip to content
ENG

First flow

Create an empty Mulesoft project called “mulesoft-curso-basico-ejercicio-1” where, in the XML file (if there is none, create a Mule Configuration File), you will do the following:

Create two flows,

  • The first one will have a Scheduler and a Flow-Reference pointing at the second flow.
  • The second flow will only have a Logger with the message Hola Mundo!

The expected process flow would be this one:

  1. Start
  2. Scheduler
  3. Flow Reference
  4. Subflow
    1. Logger
  5. End

Swipe to see the whole flow

Note: start and end are illustrative only.

  • Remember that every component, flow, Source operation and Process operation lives in the Mule palette.
  • Since the first flow holds a Scheduler, which is a Source, it has to be a Flow.
  • Since the second flow only has a Logger, which is a Process, and has no Source, that flow should be a subflow.

🔒🔓Show solution

Copy and paste this into a new Mule XML file to see the solution.

<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:ee="http://www.mulesoft.org/schema/mule/ee/core" xmlns="http://www.mulesoft.org/schema/mule/core"
xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/ee/core http://www.mulesoft.org/schema/mule/ee/core/current/mule-ee.xsd">
<flow name="mulesoft-curso-basico-1Flow" doc:id="37065e24-cb66-4799-8c3a-ed4fced5e31f" >
<scheduler doc:name="Scheduler" doc:id="31aa124f-b8f0-4770-a97f-8f3c00541817" >
<scheduling-strategy >
<fixed-frequency frequency="999999999" timeUnit="DAYS" startDelay="999999999"/>
</scheduling-strategy>
</scheduler>
<flow-ref doc:name="mulesoft-curso-basico-1Sub_Flow" doc:id="d518daa8-d0b7-4562-bcaa-e8bada98a6e2" name="mulesoft-curso-basico-1Sub_Flow"/>
</flow>
<sub-flow name="mulesoft-curso-basico-1Sub_Flow" doc:id="d211b398-57de-4884-afd6-6dbbd3d8a594" >
<logger level="INFO" doc:name="mostrar mensaje" doc:id="fd2fa63e-c636-493a-9511-4a215f8001f1" message="Hola Mundo!" />
</sub-flow>
</mule>

Last updated:

{Code mat;}

Learn MuleSoft: courses, exercises and quizzes. Free, no sign-up.