0

I have a catalog of Mule 3.9 apps that I need to convert to 4.0+ compliant apps. I have worked through many minor issues but I am stuck on one thing.

Many of these apps use several configuration XMLs to modularize the design. I am having difficulty getting flow references to work when they are in a different XML. In the example here, the reference in dms-document-api.xml to a subflow in dms-document-post.xml is not recognized. (none of those 3 are recognized, but the one I am highlighting is "postDocumentFlow")

    <flow name="post:document:dms-document-api-config">
        <set-variable variableName="postRequest" value="#[message.payloadAs(java.lang.String)]" doc:name="set saveRequest"/>
        <flow-ref name="captureAuditDataSub_Flow" doc:name="captureAuditDataSub_Flow"/>
        <flow-ref name="postDocumentFlow" doc:name="postDocumentFlow" metadata:id="96800570-1794-4aa4-9855-a48e054c0cfa"/>
        <flow-ref name="publishAuditDataSub_Flow" doc:name="publish Audit Data"/>
    </flow>

This is my mule-artifact.json (I have tried with and without paths)

{
    "minMuleVersion": "4.9.0",
    "javaSpecificationVersions": ["17"],
    "configs":[
        "./src/main/app/global.xml",
        "./src/main/app/audit-client.xml",
        "./src/main/app/common-api-handler.xml",
        "./src/main/app/dms-document-api.xml",
        "./src/main/app/database-api.xml",
        "./src/main/app/dms-document-get.xml",
        "./src/main/app/dms-document-post.xml",
        "./src/main/app/cmis-api.xml"
    ]
}

I don't know what I don't know, so if there are other files and configurations needed to diagnose my error, please ask and I will edit them back into this question.

The literal error is

Reference to unknown flow or sub flow: "getDocumentFlow"

I tried the suggestion below. After a clean and build there are no problems listed in the "Problems" tab or red Xs on the XMLs in the outline, but the problems still show in the XML editor and the project cannot be launched.

Restarting Anypoint Studio restored the report of the errors in the project view.

2
  • "not recognized" is not helpful. What is the actual, complete, literal error? Copy the text in the question. Share the sub flows and file names where they are. It would be better to share an minimal reproducible example. Commented Apr 18 at 14:31
  • Did you import the XMLs in global config? I remember missing that step and scratching my head for 3 days because of it. Something like this <import doc:name="Import" file="echo.xml" doc:id="..." />. help.salesforce.com/s/articleView?id=001114884&type=1 Commented Apr 21 at 6:37

2 Answers 2

1

You need to import the XMLs in global config to make them visible to your application. Something like this

<import doc:name="Import" file="global.xml" doc:id="..." />

You can refer to this help article: How to call to a shared flow in Mule 4

Sign up to request clarification or add additional context in comments.

Comments

0

Try deleting the configs key in mule-artifact.json. Normally those entries are not needed to be written manually because they are generated automatically at build time.

2 Comments

This did not change the symptom. "Reference to unknown flow or sub flow: "getDocumentFlow""
Please provide the details of errors or symptoms in the question.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.