Skip to content

Mulesoft analyser

Setup

Download

Click here to request a download link to our workato tools

Create anypoint connected apps

In anypoint, create a connected app of type 'App that acts on its own behalf' with the following scopes:

API Manager > Application Viewer
Exchange > Exchange Viewer
General > View Environments in a particular organization
General > View Organization
OpenID > Profile
Runtime Manager > Read Applications
Runtime Manager > Read Runtime Fabrics

Create configuration file

You can set your credentials by either using Enhanced mule tools maven or CLI, or by manually creating the file

mvn com.aeontronix.enhanced-mule:enhanced-mule-tools-maven-plugin:1.4.62:shell "-Dcmd=config clientcreds <client-id> <client-secret>"

This requires you to install the enhanced mule tools CLI ( see : https://docs.enhanced-mule.com/tools/setup.html ), and then run:

emt config clientcreds <client-id> <client-secret>

Under your user home, create a file .enhanced-mule.config.json with the following content (replacing <client-id> and <client-secret> with your connected apps client id and secret)

{
  "profiles" : {
    "default" : {
      "credentials" : {
        "type" : "client",
        "clientId" : "<client-id>",
        "clientSecret" : "<client-secret>"
      }
    }
  },
  "active" : "default"
}

Usage

Scan anypoint organization and generate report

The analyse-code can be used to scan a whole anypoint organization and generate a report.

java -jar syntek-workato-mulesoft-analyser-mule-1.0.0.jar analyse

It is possible specify the file name of the report, and have different types of reports (JSON or Excel) generated based on the file extension. ie:

java -jar syntek-workato-mulesoft-analyser-mule-1.0.0.jar analyse -r anypoint-report.json
java -jar syntek-workato-mulesoft-analyser-mule-1.0.0.jar analyse -r anypoint-report.xlsx

It is also possible to specify that only certain applications or flows to used for the report generation, by passing one or more -i parameter followed by the application source (see full report to get the source value), optionally followed by the | pipe symbol and a flow

For example to only include the application source 'exchange://f1e0c4a0-5941-48e9-8a79-2c6237b34cba/enhanced-mule-demo/1.0.0-SNAPSHOT-2024010211521991'

java -jar syntek-workato-mulesoft-analyser-mule-1.0.0.jar analyse -r anypoint-report-filtered.xlsx -i exchange://f1e0c4a0-5941-48e9-8a79-2c6237b34cba/enhanced-mule-demo/1.0.0-SNAPSHOT-2024010211521991

To only include the flow api-router in the application source 'exchange://f1e0c4a0-5941-48e9-8a79-2c6237b34cba/enhanced-mule-demo/1.0.0-SNAPSHOT-2024010211521991'

java -jar syntek-workato-mulesoft-analyser-mule-1.0.0.jar analyse -r anypoint-report-filtered.xlsx -i exchange://f1e0c4a0-5941-48e9-8a79-2c6237b34cba/enhanced-mule-demo/1.0.0-SNAPSHOT-2024010211521991|api-router -i exchange://f1e0c4a0-5941-48e9-8a79-2c6237b34cba/enhanced-mule-demo/1.0.0-SNAPSHOT-2024010211521991|other-flow

Additionally, it is also possible to re-use a previously generated json report to generate a new one, which can be useful to generate multiple filtered reports:

java -jar syntek-workato-mulesoft-analyser-mule-1.0.0.jar analyse -u anypoint-report-orig.json -r anypoint-report-filtered.xlsx -i exchange://f1e0c4a0-5941-48e9-8a79-2c6237b34cba/enhanced-mule-demo/1.0.0-SNAPSHOT-2024010211521991|api-router

Generate report from jar file

The analyse-code can be used to analyse and generate a report.

java -jar syntek-workato-mulesoft-analyser-mule-1.0.0.jar  analyse-code [jar file path]

It is possible specify the file name of the report, and have different types of reports (JSON or Excel) generated based on the file extension.

ie:

json report:

java -jar syntek-workato-mulesoft-analyser-mule-1.0.0.jar analyse-code ../testapp/target/testapp-1.0.0-SNAPSHOT-mule-application.jar -r report-from-jar.json

excel report:

java -jar syntek-workato-mulesoft-analyser-mule-1.0.0.jar analyse-code ../testapp/target/testapp-1.0.0-SNAPSHOT-mule-application.jar -r report-from-jar.xlsx