ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Convert XML message to CWF

Post new topic  Reply to topic
 Convert XML message to CWF « View previous topic :: View next topic » 
Author Message
r4lukk4
PostPosted: Thu Jan 11, 2007 5:03 pm    Post subject: Convert XML message to CWF Reply with quote

Novice

Joined: 29 Nov 2006
Posts: 20

Hi,

I´m trying to convert a XML message to CWF, because I need to send to the output queue, a text message.

I defined the CWF message into a Compute_Node, and there I try to convert the input format message to the new one, but I´m sending a empty message to the output queue.

My code is:
CREATE COMPUTE MODULE "Arquivo_Petição_Verificação_dívida"
CREATE FUNCTION Main() RETURNS BOOLEAN
BEGIN
CALL CopyEntireMessage();
RETURN TRUE;
END;

CREATE PROCEDURE CopyEntireMessage() BEGIN
DECLARE integracao CHARACTER;

IF (InputRoot.MQMD.ReplyToQ = 'I00.SBL.TXT.Q02') THEN
SET integracao = TRUE;
ELSE
SET integracao = FALSE;
END IF;

--SET OutputRoot = InputRoot;

DECLARE MSG, M, N, O, P, Q CHARACTER;
DECLARE Pattern CHARACTER 'yyyyMMddHHmmss';
DECLARE I, J, K, L INTEGER;
DECLARE space CHARACTER;
DECLARE evento CHARACTER;
DECLARE id_evento CHARACTER;
--Espaços em branco para preencher o campo correspondente ao CPF no SGC
DECLARE bl_cliente CHARACTER;
--Espaços em branco para preencher o campo correspondente ao Cliente no SGC
DECLARE bl_cpf CHARACTER;

SET K = 1;
SET L = 79;
SET space = ' ';

WHILE K < L DO
SET space = space || ' ';
SET K = K + 1;
END WHILE;

--<Evento de chamada por tipo consulta>
SET I = 1;
SET J = CARDINALITY (InputRoot.*[]);
WHILE I < J DO
IF ((InputRoot.*[I] LIKE '%CEGTipoConsulta%')= TRUE) THEN
SET M = SUBSTRING(InputRoot.*[I] FROM (LENGTH('[CEGTipoConsulta] = "') - 1));
SET M = LEFT(M, POSITION('"' IN M));
IF (M = '01') THEN
SET evento = '00010';
SET id_evento = '01';
SET bl_cpf = ' ';
ELSE
SET evento = '00011';
SET id_evento = '02';
SET bl_cliente = ' ';
END IF;
END IF;
SET I = I + 1;
END WHILE;
--</Evento de chamada por tipo consulta>

--<Mapeamento cabeçalho adaptador SGC>
IF (integracao = TRUE) THEN
SET MSG = '34';
ELSE
SET MSG = '01';
END IF;

SET MSG = MSG ||'SGC 0000100100 '|| space;
--</Mapeamento cabeçalho adaptador SGC>

--<Mapeamento cabeçalho mensagem>
SET MSG = MSG ||'01SBLSGCSBLSGC07 '|| evento ||'CEG '|| CAST(CURRENT_TIMESTAMP AS CHARACTER FORMAT Pattern);
--</Mapeamento cabeçalho mensagem>

--<Mapeamento campos da query>
SET MSG = MSG || '02' || id_evento;

SET I = 1;
SET J = CARDINALITY (InputRoot.*[]);
WHILE I < J DO
SET M = InputRoot.*[I];
IF ((M LIKE '%CEGCliente%')= TRUE) THEN
SET K = POSITION('CEGCliente' IN InputRoot.*[I]);
SET M = SUBSTRING(M FROM (LENGTH('[CEGCliente] = "') - 1));
SET N = LEFT(M, POSITION('"' IN M)); --Cliente ou CPF
ELSEIF ((M LIKE '%CEGTipoMercado%')= TRUE) THEN
SET K = POSITION('CEGTipoMercado' IN InputRoot.*[I]);
SET M = SUBSTRING(M FROM (LENGTH('[CEGTipoMercado] = "') - 1));
SET O = LEFT(M, POSITION('"' IN M)); --Tipo Mercado
ELSEIF ((M LIKE '%CEGLogin%')= TRUE) THEN
SET K = POSITION('CEGLogin' IN InputRoot.*[I]);
SET M = SUBSTRING(M FROM (LENGTH('[CEGLogin] = "') - 1));
SET P = LEFT(M, POSITION('"' IN M)); --Login usuario
ELSEIF ((M LIKE '%CEGTipoConsulta%')= TRUE) THEN
SET K = POSITION('CEGTipoConsulta' IN InputRoot.*[I]);
SET M = SUBSTRING(M FROM (LENGTH('[CEGTipoConsulta] = "') - 1));
SET Q = LEFT(M, POSITION('"' IN M)); --Tipo Consulta
END IF;
SET I = I + 1;
END WHILE;

--<Consulta por cliente ou por CPF>
IF (id_evento = '01') THEN
SET MSG = MSG || N || bl_cpf;
ELSEIF (id_evento = '02') THEN
SET MSG = MSG || bl_cliente || N;
END IF;
--</Consulta por cliente ou por CPF>
SET MSG = MSG || O || P || Q;
--</Mapeamento campos da query>

SET OutputRoot.Properties.MessageSet = 'PS5FJ5G002001';
SET OutputRoot.Properties.MessageType = 'VERIFICACAO_DIVIDA';
SET OutputRoot.Properties.MessageFormat = 'CWF';

SET OutputRoot.MQMD.ReplyToQMgr = 'D00';
SET OutputRoot.MQMD.ReplyToQ = 'D00.SGC.TXT.Q00';

SET OutputRoot.MRM = MSG;
RETURN;
END;
END MODULE;



Could you help me with this fatal error, please?

Thanks.
_________________
R4lukk4
Back to top
View user's profile Send private message
r4lukk4
PostPosted: Thu Jan 11, 2007 6:01 pm    Post subject: Reply with quote

Novice

Joined: 29 Nov 2006
Posts: 20

Hi again!

I changed my code to try to resolve my error, and now I have the following error "RM Dictionary Not Found". I think that the problem is in the new message definition.

Can anyone help me, please?

Thanks a lot.
_________________
R4lukk4
Back to top
View user's profile Send private message
gregop
PostPosted: Thu Jan 11, 2007 11:56 pm    Post subject: Reply with quote

Voyager

Joined: 24 Nov 2006
Posts: 81

You need to add your message set to a bar file and deploy to your Execution Group
Back to top
View user's profile Send private message
r4lukk4
PostPosted: Fri Jan 12, 2007 3:59 am    Post subject: Reply with quote

Novice

Joined: 29 Nov 2006
Posts: 20

Thanks gregop,

I'll test it
_________________
R4lukk4
Back to top
View user's profile Send private message
r4lukk4
PostPosted: Fri Jan 12, 2007 5:04 am    Post subject: Reply with quote

Novice

Joined: 29 Nov 2006
Posts: 20

It isn´t run...
_________________
R4lukk4
Back to top
View user's profile Send private message
gregop
PostPosted: Fri Jan 12, 2007 5:51 am    Post subject: Reply with quote

Voyager

Joined: 24 Nov 2006
Posts: 81

Quote:
It isn´t run...


What do mean ? Still getting 'RM Dictionary not found' error ?
Back to top
View user's profile Send private message
r4lukk4
PostPosted: Fri Jan 12, 2007 6:47 am    Post subject: Reply with quote

Novice

Joined: 29 Nov 2006
Posts: 20

Yes, I have the same error...
_________________
R4lukk4
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Fri Jan 12, 2007 6:49 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Then your message set didn't deploy properly.

Or you're not using the right information to tell Broker to use your message set.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Convert XML message to CWF
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.