Questions tagged [anypoint-studio]

Anypoint Studio (formerly know as Mule Studio) is an Eclipse-based integration development environment from MuleSoft.

1133 questions
2
votes
1 answer

Insert dynamic data based on array size in json mule 4

Existing JSON: { "name":"abc", "place": "äbc" } I have a separte array as below: [documentDetails:{ "name" : "doc1", "size" : "5" }, documentDetails:{ "name" : "doc1", "size" : "5" } ] Final JSON REQUIRED: { …
HMT
  • 2,093
  • 1
  • 19
  • 51
2
votes
1 answer

is it possible to Extract file name from octet stream?

I have to send an octet stream fetched from S3 through an api. I need to change the name of the file received. Does octet stream contain the name of the file ? if yes ,How can I extract the file name from the octet stream ? if no, is there any other…
HMT
  • 2,093
  • 1
  • 19
  • 51
2
votes
1 answer

How do you use variable as key in Dataweave

output application/json var name = vars.uname --- { vars.name: name, //-----> Here i am not able too retreive variable as key description: payload.text } for reference
Sri Rockz
  • 85
  • 1
  • 9
2
votes
2 answers

how to check whether the JSON recieved is empty/ nulll in mule 4

I am trying to check whether the json object is empty/ null but I am getting the following error: org.mule.runtime.core.api.expression.ExpressionRuntimeException: "Unable to parse empty input, while reading `obj` as Json. 1| ^ Trace: at main…
HMT
  • 2,093
  • 1
  • 19
  • 51
2
votes
1 answer

Dataweave 1.0 Add Items to Array

My sample payload is given below: { "ID": "72a6dcc0", "SourceCode": "ABC", "TargetCode": "DEF", . . . . . "Products": [ { "ProdId": "410ef294", "ProdDetails": { "ProdIdentifier": "410ef294-e80b", …
2
votes
2 answers

Extract Value From Dynamic JSON payload

I am running Mule 3 and is on dataweave 1.0 I have a JSON payload (with dynamic key and value) which occurs inside a For Each loop. Sample data is given below: { "094d29c7-6abf-4acb-8513-e1d2d2b8998a": "900145600114256" } The key is UUID and…
2
votes
1 answer

How to calculate minimum in mule

I want to calculate the minimum of vars.a , vars.b , vars.d-vars.c min[vars.a,vars.b,vars.d-vars.c] is not working Math.min(Math.min(vars.a,vars.b),vars.d - vars.c) is also not working I m trying to add this logic in a transform and I am using…
HMT
  • 2,093
  • 1
  • 19
  • 51
2
votes
1 answer

Concatenating two arrays in mule

I am trying to concatenate two arrays: arr1: [{"a":"value"}] arr2: [{"b":"value"}] expected result:[{{"a":"value"},{"b":"value"}}] vars.arr1 ++ vars.arr2 gives an error when arr1 is null. …
HMT
  • 2,093
  • 1
  • 19
  • 51
2
votes
1 answer

Concept of default headers in mule

I want to understand the concept of default header in mule.I want to hit a get api call[the code is written in java] from mule and I am sending a token in the header, but I am setting the token in the default header inside the http request…
HMT
  • 2,093
  • 1
  • 19
  • 51
2
votes
1 answer

Extract field from array using DW 1.0 function

I have a session variable called varIP1 which has a value like below: (It's mime type is application/java) {abc={FedId=abc, Id=01FcLA, type=User, Profile={Id=02EmQA, type=Profile, Name=Analyst}}} I am interested in extracting the first Id (01FcLA)…
2
votes
1 answer

Mule4 Cannot find custom java class

I'm using Anypoint Studio 7 and having an IDE problem using custom java class in src/main/java. I'm referencing it using java:invoke. The error is something like this. Unable to find type 'com.sample.TestClass' on build path of project…
Mnick
  • 233
  • 3
  • 15
2
votes
2 answers

Renaming and Deleting attributes in same array using dataweave

My sample input payload is given below: { "entities": [ { "Id": "ab5fdd89e123", "target": { "Data": { "attributes": { "Name": [], "Address": [ { "value": { "AddType": [{"value":…
Triumph Spitfire
  • 663
  • 15
  • 38
2
votes
1 answer

How to convert json to Object in mule 4

My json looks like this : { "key1" : "aa", "key2" : "bb" } and java class looks like this : public class Example { @NotBlank @Size(min = 3, max = 5) private String key1; @Pattern(regexp=".+@.+\\.[a-z]+") // email private String key2; } I used…
HMT
  • 2,093
  • 1
  • 19
  • 51
2
votes
1 answer

How to handle "Couldn't get any response" in mule?

I am trying to implement proper error handling in my code. There is a request component, which hits a specific api. I have to handle the scenario, where "server couldn't send a response" exception occurs. Mule does not identify it as a HTTP:NOT…
HMT
  • 2,093
  • 1
  • 19
  • 51
2
votes
3 answers

How to fetch value from property file when my key is a dynamic in mule?

I am trying to fetch value from the properties file "mykey" = "value" "mykey1" ="value2" in mule, we can fetch the value by ${mykey}, but what if mykey is stored in a variable named keyName. I tried fetching the value by writing ${(#vars.keyName)}…
HMT
  • 2,093
  • 1
  • 19
  • 51