Posts

Showing posts from November, 2018

Mulesoft Murmurings

Introduction This blog is a series of tips, tricks and how to's relating to developing APIs in Mulesoft Anypoint Studio. MEL Expressions Create a boolean IF THEN statement In MEL expression, the  ?  creates an if statement based on the expression before it. #[ flowVars .flowName == empty ?  "updateCustomer" ] To add a else clause, add  :  after setting the if condition. #[ flowVars .flowName == empty ?  "updateCustomer"  :   flowVars .flowName +  "->updateCustomer" ] How to's  Add time taken to a http flow 1.) Add a variable component at the beginning of the flow. 2.) Set the Value to  #[System.currentTime TimeMillis() ] 3.) Set the Name to 'flowName'+StartTime. (FLOWNAME MUST BE UNIQUE) 4.) Add a logger component at the end of the flow. 5.) Set Value  #[ timeTaken=#[System.currentTimeMillis() -  flowVars . flowname StartTime] ] NOTE : FlowName variable cannot contain - (dash)...