Author |
Message
|
jsanchose |
Posted: Tue May 09, 2006 6:45 am Post subject: Passing Environment from a flow to another |
|
|
Novice
Joined: 26 Apr 2006 Posts: 16
|
Hi.
I'm using SWIFT_2005_050615 message set.
I've this schema:
Queue1 --> SpecificFlow --> Queue2
Queue2 --> CommonFlow --> Queue3 --> MQSA --> SAA --> SWIFTNet
I've a specific flow for each MTxxx message and only one common flow for validation and other common treatments.
SpecificFlow sets Environment variables and I need to pass them to CommonFlow.
is it possible?.
using MQRFH2?
...or I must to store Environment variables in OutputRoot.
Thanks. |
|
Back to top |
|
 |
madi |
Posted: Tue May 09, 2006 6:56 am Post subject: |
|
|
 Chevalier
Joined: 17 Jan 2006 Posts: 475
|
can you eliminate Queue2 and just have a subflow??
--madi |
|
Back to top |
|
 |
wschutz |
Posted: Tue May 09, 2006 6:58 am Post subject: |
|
|
 Jedi Knight
Joined: 02 Jun 2005 Posts: 3316 Location: IBM (retired)
|
I assume the message in queue2 is in swift format. If it were me, I'd stroe your specific variables in the usr folder of MQRFH2 to pass from flow 1 to flow 2. _________________ -wayne |
|
Back to top |
|
 |
jsanchose |
Posted: Tue May 09, 2006 7:47 am Post subject: |
|
|
Novice
Joined: 26 Apr 2006 Posts: 16
|
madi, I've 51 specific flows and only one common flow, if I change CommonFlow by a SubFlow, the SubFlow will be replicated 51 times.
I win independence having a separated common flow.
wschutz, yes, the MessageType is SwiftEnvelope and I'm trying with MQRFH2.usr, but this field is stored after MRM field causing an Exception in MQOutput node.
Thanks. |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue May 09, 2006 7:49 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Fields in the message on the queue are written out in the order they are created in the ESQL.
So if your message does not already have an MQRFH2, and you want to add one, you will need to create a new MQRFH2 header and you will need to do it BEFORE you assign anything to OutputRoot.MRM.
Maybe you want to use the Broker Domain Data Store (cache) nodes instead. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
madi |
Posted: Tue May 09, 2006 8:11 am Post subject: |
|
|
 Chevalier
Joined: 17 Jan 2006 Posts: 475
|
Quote: |
, the SubFlow will be replicated 51 times. |
i think that is exactly why u need a subflow
may be im not getting something ...... just so you know ...a subflow will just be one node representing the whole "SubFlow" which you can use anywhere you want
the changes you make to the actual subflow will apply to all your 51 subflow nodes.
do some reading on subflows and u will know what i mean .... having a seperate queue just for that reason doesn't make sense!!
jus try replacing the MQInput node with Input node(in your "Subflow") and right click where you want to add the subflow .. then say add subflow and then select your "Subflow"
--madi |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue May 09, 2006 8:28 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
madi wrote: |
the changes you make to the actual subflow will apply to all your 51 subflow nodes. |
The changes you make in a subflow will only be reflected in the flows that you re-deploy. So in order to propagate changes to all 51 inclusions of the subflow, jsanchose will have to redeploy all 51 specificFlows.
This isn't necessarily a bad thing, but it should be kept in mind. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
jsanchose |
Posted: Tue May 09, 2006 8:51 am Post subject: |
|
|
Novice
Joined: 26 Apr 2006 Posts: 16
|
madi, subflow would be a valid solution but I prefer a separated flow for some reasons:
- Maintenance of Common flow is responsability of Infrastructure Support Group.
- Development of Specific flows is reponsability of many application programmers.
I want independence.
jefflowrey, your solutcion is good.
Here ESQL lines.
After CopyMessageHeaders, MQRFH2 is created.
-- Copiamos las cabeceras MQMD
CALL CopyMessageHeaders();
-- Escribimos un campo dummy para crear MQRFH2.usr que al final sera borrado.
SET OutputRoot.MQRFH2.usr.DUMMYFIELD = 'nothing';
...many, many lines of ESQL.
At end Environment is assigned and DUMMYFIELD is deleted.
/* Guardamos las variables de entorno en MQRFH2 para pasarselas
al flujo comun de envio a SWIFT, despues de esto borramos el campo
ficticio DUMMYFIELD que habiamos escrito para que MQRFH2 este entre
MQMD y MRM. */
SET OutputRoot.MQRFH2.usr.VARIABLES = Environment.Variables;
DELETE FIELD OutputRoot.MQRFH2.usr.DUMMYFIELD;
-- Salida del modulo por la pata de OUT.
RETURN TRUE;
END;
Thanks everybody. |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue May 09, 2006 8:34 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
You cannot just create an RFH2 header without changing some of the attributes:
On the MQMD.Format you have to set the correct value for RFH2 header. The value you just overwrote there needs to go into the format field of the RFH2 header etc...
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
|