Questions tagged [mule4]

Version 4 of Mule, a lightweight enterprise service bus (ESB) and integration framework provided by MuleSoft

Mule is a lightweight enterprise service bus (ESB) and integration framework provided by MuleSoft. According to the documentation, Version 4 aims at simplifying the expression language and reducing management complexity. This way, it shall be possible to deliver applications faster than in earlier versions of the product.

1166 questions
1
vote
1 answer

Deploying to the CloudHub fails with the error in the YAML

I am trying to deploy the mulesoft application in to the DEV CloudHub using the Azure Devops CI/CD Pipeline. But when the application getting deployed in to the Cloud Hub it throws error like ConfigurationPropertiesException: YAML configuration…
user4912134
  • 1,003
  • 5
  • 18
  • 47
1
vote
1 answer

How to replace child node names of an XML

I'm trying to replace the child node names "Layer01", "Layer02" "Layer03", and so on, with "Layer" in an XML document. In Mule 3 I used: payload.replaceAll('Layer\\d\\d','Layer') The logic is to replace the child nodes that start with the string…
codey_08
  • 249
  • 1
  • 11
1
vote
2 answers

remove all the extra lines from the array in mule 4

I want to remove the extra lines or "\n\r" & "\n" from the array but my solution is not working. Please provide the correct function or dataweave for this. input (json array format): [{"m":"a\n\r", "a":"b\n"}, {"m":"a\r\n", …
Devendra
  • 219
  • 2
  • 22
1
vote
1 answer

Mocking a connector throws error like Element not defined in Mule Registery

I am creating the Munit tests and mocking the salesforce connector for the query. The Query response in the flow returns the payload in application/java type. So below is the Mock the setting
user4912134
  • 1,003
  • 5
  • 18
  • 47
1
vote
2 answers

Mule 4.4 DataWeave append counter to file

I am reading in a file (see below). The example file has 13…
1
vote
3 answers

MuleSoft Transform Message that Modifies Content of String Field

How would I modify the following MuleSoft Transform Message to reverse the concatenation of the EMPLOYEE_CODE field? Background: I am working with a MuleSoft process that (i) queries data from a database using a 'SELECT' component (ii) then…
1
vote
1 answer

Convert the string to integer or number

How can I convert the string in to the number/integer inside the transfor dataweave. I tried the below %dw 2.0 import * from dw::util::Coercions output application/json --- { "quoteId" : vars.setQuoteOppRecIds.Id, "productCode" :…
trx
  • 2,077
  • 9
  • 48
  • 97
1
vote
1 answer

Mule 4: Dataweave: Query a key dynamically based on a value

I have below input { "OrderId": "TST-test-123212-01", } I have to fetch sfdc id using this value from a variable which I get from another source. I tried with below code %dw 2.0 output application/json var lis = { "TST-test-123212-01":…
Prudhvi B
  • 144
  • 2
  • 13
1
vote
0 answers

Character encoding issue with Mulesoft IBM MQ Connector

Problem Description: We are trying to transfer a zip file to a destination coming from an IBM MQ queue. The Mulesoft flow has an IBM MQ 'On New Message' connector as a source. Whenever there is a new message in the IBM MQ queue, the connector picks…
1
vote
1 answer

Unable to resolve reference of zeroPad2 and Unable to call `map` with (`Any`, ($, $$) -> `?`) error in mule 4

I'm trying to migrate from Dataweave 1.0 to 2.0 and please don't consider the variable in that given DWL. I'm facing the following error: Unable to resolve reference of zeroPad2. Unable to call `map` with (`Any`, ($, $$) -> `?`): - 55| …
codey_08
  • 249
  • 1
  • 11
1
vote
4 answers

Convert to proper dateTime format - dataweave

I have a request coming as below format { "updatedTime": "Mon Mar 14 15:34:47 NZDT 2022" } The response should be converted to "yyyy-MM-dd'T'HH:mm:ss" { "updatedTime": "2022-03-14'T'15:34:47" } I also referred to Mule docs…
star
  • 1,493
  • 1
  • 28
  • 61
1
vote
3 answers

Mule 4 dynamic queries in the Database Connector

In my flow in Mule 4 I am trying to query a database for specific data. For example I want to run a query like this: SELECT * FROM mulesoft WHERE plant = CCCNNB; The thing is both plant and CCNNB need to be dynamic. They will come through an API…
davidb
  • 1,503
  • 4
  • 30
  • 49
1
vote
4 answers

Extract the inner field objects and apply them to respective top level objects using Dataweave2.0

I am trying to achieve the below output from the given input. I have tried several ways of making a generic function so that when any data is passed with similar structure I get the similar output. Please help me to achieve this. Input [{ "name":…
Thinker-101
  • 554
  • 5
  • 19
1
vote
1 answer

How to remove the attribute that returns null in XML using Mule 4?

I need to remove "null" attributes from an XML using dataweave 2.0, I tried skipNullOn="everywhere" and skipOnNull="attribute" is working only on elements not on attributes. Error on using skipNullOn : "Option `skipOnNull` is not valid. Valid…
codey_08
  • 249
  • 1
  • 11
1
vote
2 answers

How to dynamically set JSON field name in Mule 4

JSON received from API. { "success": true, "timestamp": 1645988822, "base": "EUR", "date": "2022-02-27", "rates": { "AED": 4.140586, "AFN": 102.662987, "ALL": 121.380824, "AMD": 538.7856, "ANG": 2.016644, "AOA":…