es.davy.ai

Preguntas y respuestas de programación confiables

¿Tienes una pregunta?

Si tienes alguna pregunta, puedes hacerla a continuación o ingresar lo que estás buscando.

Tag: DATAWEAVE

El archivo CSV generado por DataWeave 2.0 tiene una línea vacía al final. ¿Cómo eliminar la línea vacía?

Mi carga útil es lang-json [ { "type": "Code", "method": "more", "Service": "Post", "Service_ID": "1" }, { "type": "Code", "method": "more", "Service": "Put", "Service_ID": "2" }, { "type": "Code", "method": "more", "Service": "get", "Service_ID": "3" } ] Código DataWeave para transformarlo en CSV con datastream: %dw 2.0 output application/csv header=true, . . . Read more

No se puede comprobar si un archivo existe utilizando la función Java dentro de Dataweave 2.

Desearía poder verificar si un archivo existe utilizando algunas funciones de Java dentro de un script de Dataweave 2.0: %dw 2.0 output application/dw import java!java::nio::file::Files::exists import java!java::nio::file::Paths::get — exists(get(“C:\Users\mhery\stackoverflow.csv”)) Pero recibo el siguiente error: ‘exists(get(“C:\Users\mhery\stackoverflow.csv”))’ tiene errores: No se puede resolver el módulo con el identificador java::nio::file::Files::exists. en 3 : . . . Read more

Cambiar fecha en Dataweave

Tengo un script como este: %dw 2.0 output application/csv — payload.data map (item, index) -> { created_time: item.created_time as String {format: “yyyy-MM-dd”}, } Y el created_time es “2021-11-29T13:02:04+0000” y me gustaría cambiar la fecha a un formato diferente, pero la sintaxis no funciona. ¿Alguien puede ayudarme?

Iteración de Matriz JSON – Travesía de Árbol en Mulesoft

JSON de entrada: { “id”: “/”, “code”: “/”, “typeCode”: “CPC”, “timeStamp”: “2021-11-16T17:00:00-06:00”, “childList”: [ { “id”: “577-1-1”, “code”: “1111”, “name”: “Electronics-1-1”, “displayName”: “Electronics-1-1”, “active”: true, “languageCode”: “en”, “typeCode”: “CPC”, “childList”: [ { “id”: “579-2-1”, “code”: “2222”, “name”: “Calculators-2-1”, “displayName”: “Calculators-2-1”, “active”: true, “languageCode”: “en”, “typeCode”: “CPC”, “childList”: [] }, { . . . Read more