|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Java Plugin Node API - Retrieving name of messageflow |
« View previous topic :: View next topic » |
Author |
Message
|
jpm |
Posted: Thu May 08, 2003 9:12 am Post subject: Java Plugin Node API - Retrieving name of messageflow |
|
|
 Newbie
Joined: 23 Apr 2003 Posts: 6
|
Hi,
I have written a java plugin node that is used in several different flows. The plugin node writes logging info to a file.
I want to log the name of the flow that is using the node. For example, if the node is contained in
FLOW1.FLOW2.FLOW3.FLOW4.node
I want to log "FLOW1.FLOW2.FLOW3.FLOW4"
I tried MbMessageFlow.getName(), but this only returns the top level flowname i.e. "FLOW1"
Is it possible to obtain the full flow heirachy name ( as viewed in a trace)?
Thanks,
John |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu May 08, 2003 1:07 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Are you saying that you are calling your java node from the following:
Code: |
Message Flow: FLOW1
SubFlow: FLOW2
SubFlow: FLOW3
SubFlow: FLOW4
javaNode |
That's all "running" in FLOW1. Think of SubFlows as method calls. They're *really* contained WITHIN the main flow, they aren't called as separate execution units. |
|
Back to top |
|
 |
Ian |
Posted: Fri May 09, 2003 1:26 am Post subject: |
|
|
Disciple
Joined: 22 Nov 2002 Posts: 152 Location: London, UK
|
This analysis is correct, the concept of a subflow only exists in the Control Center.
When a messageflow is deployed to a broker all subflows are combined into the one messageflow and therefore the broker only has one messageflow which in the Control Center is represented by a main flow with a number of sub flows.
The best way to view this is by the fact that only the main messageflow is deployed and you don't have to deploy the sub flows seperately to the broker. _________________ Regards, Ian |
|
Back to top |
|
 |
jpm |
Posted: Fri May 09, 2003 2:09 am Post subject: |
|
|
 Newbie
Joined: 23 Apr 2003 Posts: 6
|
Jeff, Yes, that is what I mean. Sorry, I'm new to this.
The java plugin node is being called from a subflow, which can be called from various different subflows, hence
Code: |
Message Flow: FLOW1
SubFlow: FLOW2
SubFlow: FLOW3
SubFlow: FLOW4
javaNode
Message Flow: FLOW1
SubFlow: FLOW8
SubFlow: FLOW9
SubFlow: FLOW10
SubFlow: FLOW4
javaNode
|
Is it possible to obtain the name of the subflows, in between 'Message Flow : FLOW1' and 'SubFlow : FLOW4'? Thanks
Ian,
Thanks. What I am trying to do, is to obtain the name of the node as viewed in a user trace, which is in the form 'Flow1.Subflow2.SubFlow3.SubFlow4'. Is it possible to get this information from the Java API or an MQSI compute node? |
|
Back to top |
|
 |
jefflowrey |
Posted: Fri May 09, 2003 5:48 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
The only way you could get what you want is to have each "subflow" populate a specific variable in the Environment that included it's name and have your java node read that. If you do this properly, you can create each name in the order of calling.
For instance, in your Flow2:
Code: |
Set Environment.Variables.FlowNames.Index = Environment.Variables.FlowName.Index + 1;
Set Environment.Variables.FlowName.Names[Environment.Variables.FlowName.Index]='FLOW2'; |
Put the same code in each of your other subflows, changing the name being assigned, and when you get to your java node, you'll see an array where the names have been populated in order.
You could simplify it by using string concatenation instead of an array and an index.
But without doing something equivalent to the above, you can't do what you want. There is no "run-time" equivalent of a subflow as a real entity. It's equivalent to a procedure or method of the main flow. |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|