Hi Antonio,
The solution is the note "1827646 - XI mapping: Empty pay load for split mapping" and combining it with this note "1883809 - How to process empty payload without complex XSLT/Java mapping" you´ll get the entire solution ![]()
(la que has montado con el script).
I share with you a Java Mapping in ESR to set a correlation and a default "empty message" for a BPM:
public void transform(TransformationInput in, TransformationOutput out) throws StreamTransformationException { try { //GET FILENAME FROM ASMA String filename = ""; Map mapParameters = (Map) in.getInputHeader().getAll(); mapParameters.put(DynamicConfigurationKey.create("http://sap.com/xi/XI/Dynamic",StreamTransformationConstants.DYNAMIC_CONFIGURATION), ""); DynamicConfiguration conf = (DynamicConfiguration) mapParameters.get(StreamTransformationConstants.DYNAMIC_CONFIGURATION); DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File", "FileName"); filename = conf.get(key); //GET THE CORRELATION FROM FILENAME String correlation = filename.substring(6,20); //BUILD THE TARGET XML MESSAGE String targetxml = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?><ns1:MT_FILE_ACCORD_PEDIDOS_OBSERVACIONES_TO_ORDERS_ORDERS05_ZORDERS05_ABS xmlns:ns1=\"http://cofares.es/xi/FARMAVENIX/ClientesOperadorLogistico\"><CORRELATION>"+ correlation +"</CORRELATION><OBSERVACIONES><LINEAS><NroPedidoyContador></NroPedidoyContador><CodigoSociedad></CodigoSociedad><EjercicioPedido></EjercicioPedido><PRET></PRET><CEROS></CEROS><ObservacionesAlbaran></ObservacionesAlbaran></LINEAS></OBSERVACIONES></ns1:MT_FILE_ACCORD_PEDIDOS_OBSERVACIONES_TO_ORDERS_ORDERS05_ZORDERS05_ABS>"; //SET THE TARGET XML MESSAGE out.getOutputPayload().getOutputStream().write(targetxml.getBytes()); } catch (Exception e) { throw new StreamTransformationException(e.getMessage()); }
}Please remember close this discussion( How to close a discussion and why ).
Best Regards.


/pic7955059.jpg)


