on 06-16-2014 2:33 PM
Hi all,
I want to compare different value of a node with occurrence 1..n.
I need to put into value1 the integer with the max value of the n nodes.
For example:
I have this structure:
<MAIN>
<NODE>
<value1></value1>
</NODE>
</MAIN>
In my case, i recieved this file:
<MAIN>
<NODE>
<value1>1</value1>
</NODE>
<NODE>
<value1>2</value1>
</NODE>
<NODE>
<value1>3</value1>
</NODE>
</MAIN>
Exist any form (in JAVA or UDF wiithout ccBPM & PBM ) to compare elements of different nodes (node ocurrence 0 [value 1] with node with ocurrence 1 [value 2])?
The solution should be:
<MAIN>
<NODE>
<value1>3</value1>
</NODE>
</MAIN>
Thanks.
Regards.
Hi Alvaro,
Try below logic ,
Value1 (Source) -> Remove Context -> Sort - > UDF -> Value1 (Target)
UDF Logic :
get last value from the Queue.
Thanks
Hari.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi all,
Thanks for your response.
The problem with this scenario has been resolved.
Aditional i need to do apply a similar concept in the next scenario:
Source structure:
Tarhet structure:
I recieved this file:
And the actual result is:
I need the next transformation in target system:
I have tried to develop a Java function and context resultt but don't know like do it.
Any idea?
Thanks.
Regards.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This is the source XML:
<?xml version="1.0" encoding="UTF-8"?>
<ns0:MT_Error_process xmlns:ns0="http:/127.0.0.1/source">
<Recordset>
<CABECERA>
<M>0</M>
</CABECERA>
<ERRORES>
<Tipo_Registro>0</Tipo_Registro>
<Num_Registro_Fichero_Recibido_con_Error/>
<Contenido_del_registro_erroneo>Error 20</Contenido_del_registro_erroneo>
<Tipo_Registro_Target/>
<Num_Registro_Fichero_Recibido_con_Error_Target/>
<Contenido_del_registro_erroneo_Target/>
</ERRORES>
<ERRORES>
<Tipo_Registro>1</Tipo_Registro>
<Num_Registro_Fichero_Recibido_con_Error/>
<Contenido_del_registro_erroneo>Error 21</Contenido_del_registro_erroneo>
<Tipo_Registro_Target/>
<Num_Registro_Fichero_Recibido_con_Error_Target/>
<Contenido_del_registro_erroneo_Target/>
</ERRORES>
<ERRORES>
<Tipo_Registro>1</Tipo_Registro>
<Num_Registro_Fichero_Recibido_con_Error/>
<Contenido_del_registro_erroneo>Error 21</Contenido_del_registro_erroneo>
<Tipo_Registro_Target/>
<Num_Registro_Fichero_Recibido_con_Error_Target/>
<Contenido_del_registro_erroneo_Target/>
</ERRORES>
<ERRORES>
<Tipo_Registro>0</Tipo_Registro>
<Num_Registro_Fichero_Recibido_con_Error/>
<Contenido_del_registro_erroneo>Error 20</Contenido_del_registro_erroneo>
<Tipo_Registro_Target/>
<Num_Registro_Fichero_Recibido_con_Error_Target/>
<Contenido_del_registro_erroneo_Target/>
</ERRORES>
<FIN>
<X/>
<Y/>
</FIN>
</Recordset>
</ns0:MT_Error_process>
And the target XML that i recieved is:
<?xml version="1.0" encoding="UTF-8"?>
<ns1:EnviarRespuestaProdcontrol xmlns:ns1="http://127.0.0.1/RespuestaProdControlIncidencias.asmx">
<ns1:respuesta>
<ns1:Cabecera>
<ns1:Tipo_interfaz>M</ns1:Tipo_interfaz>
</ns1:Cabecera>
<ns1:Incidencias>
<ns1:RespuestaProdcontrolIncidencias>
<ns1:Codigo_incidencia>Error 20</ns1:Codigo_incidencia>
<ns1:Descripcion_incidencias/>
</ns1:RespuestaProdcontrolIncidencias>
<ns1:RespuestaProdcontrolIncidencias>
<ns1:Codigo_incidencia/>
<ns1:Descripcion_incidencias>Error 21</ns1:Descripcion_incidencias>
</ns1:RespuestaProdcontrolIncidencias>
<ns1:RespuestaProdcontrolIncidencias>
<ns1:Codigo_incidencia/>
<ns1:Descripcion_incidencias>Error 21</ns1:Descripcion_incidencias>
</ns1:RespuestaProdcontrolIncidencias>
<ns1:RespuestaProdcontrolIncidencias>
<ns1:Codigo_incidencia>Error 20</ns1:Codigo_incidencia>
<ns1:Descripcion_incidencias/>
</ns1:RespuestaProdcontrolIncidencias>
</ns1:Incidencias>
</ns1:respuesta>
</ns1:EnviarRespuestaProdcontrol>
I need recieved a XML like:
<?xml version="1.0" encoding="UTF-8"?>
<ns1:EnviarRespuestaProdcontrol xmlns:ns1="http://127.0.0.1/RespuestaProdControlIncidencias.asmx">
<ns1:respuesta>
<ns1:Cabecera>
<ns1:Tipo_interfaz>M</ns1:Tipo_interfaz>
</ns1:Cabecera>
<ns1:Incidencias>
<ns1:RespuestaProdcontrolIncidencias>
<ns1:Codigo_incidencia>Error 20</ns1:Codigo_incidencia>
<ns1:Descripcion_incidencias>Error 21 Error 21</ns1:Descripcion_incidencias>
</ns1:RespuestaProdcontrolIncidencias>
<ns1:RespuestaProdcontrolIncidencias>
<ns1:Codigo_incidencia>Error 20</ns1:Codigo_incidencia>
<ns1:Descripcion_incidencias/>
</ns1:RespuestaProdcontrolIncidencias>
</ns1:Incidencias>
</ns1:respuesta>
</ns1:EnviarRespuestaProdcontrol>
Thanks.
Regards.
HI,
Thanks for your response.
Yes, the logic is that one Error 20 can have more than one Error 21.
The Error 21 should be grouped for each error 20 to which it belong. (The logic to identify this, should be observed when a new error occurs 20)
For example, if i recieved this xml:
<?xml version="1.0" encoding="UTF-8"?>
<ns0:MT_Error_process xmlns:ns0="http:/127.0.0.1/source">
<Recordset>
<CABECERA>
<M>0</M>
</CABECERA>
<ERRORES>
<Tipo_Registro>0</Tipo_Registro>
<Num_Registro_Fichero_Recibido_con_Error/>
<Contenido_del_registro_erroneo>Error 20</Contenido_del_registro_erroneo>
<Tipo_Registro_Target/>
<Num_Registro_Fichero_Recibido_con_Error_Target/>
<Contenido_del_registro_erroneo_Target/>
</ERRORES>
<ERRORES>
<Tipo_Registro>1</Tipo_Registro>
<Num_Registro_Fichero_Recibido_con_Error/>
<Contenido_del_registro_erroneo>Error 21</Contenido_del_registro_erroneo>
<Tipo_Registro_Target/>
<Num_Registro_Fichero_Recibido_con_Error_Target/>
<Contenido_del_registro_erroneo_Target/>
</ERRORES>
<ERRORES>
<Tipo_Registro>1</Tipo_Registro>
<Num_Registro_Fichero_Recibido_con_Error/>
<Contenido_del_registro_erroneo>Error 20</Contenido_del_registro_erroneo>
<Tipo_Registro_Target/>
<Num_Registro_Fichero_Recibido_con_Error_Target/>
<Contenido_del_registro_erroneo_Target/>
</ERRORES>
<ERRORES>
<Tipo_Registro>0</Tipo_Registro>
<Num_Registro_Fichero_Recibido_con_Error/>
<Contenido_del_registro_erroneo>Error 21</Contenido_del_registro_erroneo>
<Tipo_Registro_Target/>
<Num_Registro_Fichero_Recibido_con_Error_Target/>
<Contenido_del_registro_erroneo_Target/>
</ERRORES>
<FIN>
<X/>
<Y/>
</FIN>
</Recordset>
</ns0:MT_Error_process>
The result should be:
<?xml version="1.0" encoding="UTF-8"?>
<ns1:EnviarRespuestaProdcontrol xmlns:ns1="http://127.0.0.1/RespuestaProdControlIncidencias.asmx">
<ns1:respuesta>
<ns1:Cabecera>
<ns1:Tipo_interfaz>M</ns1:Tipo_interfaz>
</ns1:Cabecera>
<ns1:Incidencias>
<ns1:RespuestaProdcontrolIncidencias>
<ns1:Codigo_incidencia>Error 20</ns1:Codigo_incidencia>
<ns1:Descripcion_incidencias>Error 21</ns1:Descripcion_incidencias>
</ns1:RespuestaProdcontrolIncidencias>
<ns1:RespuestaProdcontrolIncidencias>
<ns1:Codigo_incidencia>Error 20 Error 21</ns1:Codigo_incidencia>
<ns1:Descripcion_incidencias/>
</ns1:RespuestaProdcontrolIncidencias>
</ns1:Incidencias>
</ns1:respuesta>
</ns1:EnviarRespuestaProdcontrol>
Exist any way to do that?
Thanks again.
Regards.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Alvaro,
If the tags to compare are going to be always the same you can use the standard function copyValue. Check this documentation: copyValue (SAP Library - SAP Exchange Infrastructure) Example here: Standard Functions in PI 7.0 - Process Integration - SCN Wiki
When you get the values you can compare them with the equalS function.
Regards.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
95 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.