My issue is I already deploy a project in cloudhub. The flow will transform a payload into excel format and the excel file will be in the path I set.
I understand the path for local and cloudhub is different so I set to this path:${mule.home}/apps/${app.name}/FIN.xlsx . Is there any way for me to see the excel file in cloudhub? Thank you for your time. Edited: This is my example code:
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:file="http://www.mulesoft.org/schema/mule/file"
xmlns:db="http://www.mulesoft.org/schema/mule/db" xmlns:ee="http://www.mulesoft.org/schema/mule/ee/core"
xmlns:http="http://www.mulesoft.org/schema/mule/http"
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/file http://www.mulesoft.org/schema/mule/file/current/mule-file.xsd http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/ee/core http://www.mulesoft.org/schema/mule/ee/core/current/mule-ee.xsd
http://www.mulesoft.org/schema/mule/db http://www.mulesoft.org/schema/mule/db/current/mule-db.xsd">
<http:listener-config name="HTTP_Listener_config" doc:name="HTTP Listener config" doc:id="8629addc-423c-4e55-b620-1291af64f3a2" >
<http:listener-connection host="0.0.0.0" port="8081" />
</http:listener-config>
<file:config name="File_Config" doc:name="File Config" doc:id="fe9d640c-d102-49d3-8d20-f459eee91837" />
<flow name="myinsightsFlow" doc:id="85b09215-b002-4db7-bb76-ef70d131bcb6" >
<http:listener doc:name="Listener" doc:id="e59ec33b-1df0-44b3-983e-f61e8ec09dbc" config-ref="HTTP_Listener_config" path="/myInsight"/>
<set-variable value="#[payload]" doc:name="Set Variable" doc:id="0258fa4a-3f6e-4f20-8fca-9fca5a093dcc" variableName="firstPayload"/>
<logger level="INFO" doc:name="Payload From Listener" doc:id="d335d098-35f5-46b0-94e1-c9fa6427451f" message="#[vars.firstPayload]"/>
<ee:transform doc:name="Transform Message" doc:id="378829cf-8268-462d-9946-a24efa7b6955" >
<ee:message >
<ee:set-payload ><![CDATA[%dw 2.0
output application/json
// Calculate the count of queries
var queryCount = sizeOf(vars.firstPayload)
---
{
"queryCount": queryCount
}
]]></ee:set-payload>
</ee:message>
</ee:transform>
<logger level="INFO" doc:name="QueryCount" doc:id="19e5d841-e814-40bf-aa28-155564e7a64a" message="#[payload]"/>
<ee:transform doc:name="Transform Message" doc:id="e88474af-ff3a-4cc9-a05c-953ab3401380" >
<ee:message >
<ee:set-payload ><![CDATA[%dw 2.0
output application/xlsx header=true
// Calculate the count of queries
---
{
"Sheet1":vars.firstPayload
}
]]></ee:set-payload>
</ee:message>
</ee:transform>
<file:write doc:name="Write" doc:id="ed392aa2-ecb8-41e0-9cf8-6fb6c89ea228" config-ref="File_Config" path="${mule.home}/apps/${app.name}/FIN.xlsx"/>
</flow>
</mule>
I had kind of a requirement similar to you, where in my flow I generate a csv file which is read and written by dedicated flows in the application. At the end of the process, I attach the csv to an email that I send (using smtp email send with attachment). Thus this is the proof that my file is well generated or not, and if in the correct format.
As requested,here is the code :