Call a flow of one mule project in another mule project

1.9k Views Asked by At

I have a mule project-A where in I need to call a flow from another mule project-B. I have added <classifier>mule-plugin</classifier> in the project-B's pom. And I have added a dependency with project-B's group-Id, version, artifact-Id, classifier in project-A's pom and also created an "import" config in project-A with flow name of project-B which I want to use. Still I am unable to call the flow of project-B in project-A

1

There are 1 best solutions below

5
On BEST ANSWER

If you are implementing this to just test in your local machine, then follow the below steps. You can also look at the concept of Mule Domain Project, which does resource sharing for those apps falling under the same domain ; enabling you to call other apps flow-refs, global configurations and more.

Note : All this below said has to be in Mule 4.

First, export your Project-B as a mule deployable jar.

Steps

  1. Right click on Project-A and goto - > mule
  2. Add a maven dependency.
  3. Choose your Project-B.jar from your local repository and add.

    This will get your project imported as a maven dependency in your pom.xml file.

  4. Make sure your jar added under your project libraries of 'A' in the package explorer.
  5. Goto to the global elements of Project-A and select import configurations.
  6. Add the Import configuration to your elements and specify your Project-B main XML file you want to use in Project-A.
  7. Finally refresh/restart your main project and check if you can reference the flows.

If you still can't get this work, try updating to the latest version of studio, like 4.3.1 which is a much stable version.

Detailed explanation is given here -> Mule Shared Projects


Update

You can also try doing the same in your cloudhub runtime. You don't need a Domain project concept to do this. Basically you kind of imported your Project-B into Project-A completely ; Altogether making it a one mashed up Mega project.