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 » Sub Flow without Input Node

Post new topic  Reply to topic Goto page 1, 2  Next
 Sub Flow without Input Node « View previous topic :: View next topic » 
Author Message
Hulisan08
PostPosted: Tue Apr 03, 2012 5:37 am    Post subject: Sub Flow without Input Node Reply with quote

Newbie

Joined: 03 Apr 2012
Posts: 6

Hi,
I am a novice user in Message Broker with a weeks classroom training.
Thanks for this forum, i was able to reach to certain extent in the flow. Here is my flow:
I receive files<3 different type of files> from external system which is in tagged fixed length Format. I have exposed a webservice(and corresponding UI to display the contents), using which end user would be able to see the content in human readable format. using the post "FYI: Tutorial on tagged fixed length messages with MRM/TDS" i was able to create a new MRM for fixed length and a corresponding schema based on which data will be retrieved.
During the processing, the source file should not be touched, as this would be used by other process for further processing. hence i used a java compute node to copy the file in temporary folder for my processing.
I have used a routenode, which would read the request parameters and copy the right file.

Subflow starts with FileInputNode, reads the temp file, forms the MRM and using Mapping node, transform it into XMLNSC and return to the main flow with the data in XMLNSC format.

Issues that i am facing:
1> Without explicit input node, i am not sure how to link the Main flow with this sub flow
2> how to get the XML data in the main flow, which is required for my webservice response?

Looking for guidance to proceed on this.

Thanks,
Back to top
View user's profile Send private message
lancelotlinc
PostPosted: Tue Apr 03, 2012 5:43 am    Post subject: Reply with quote

Jedi Knight

Joined: 22 Mar 2010
Posts: 4941
Location: Bloomington, IL USA

"Subflow starts with FileInput node"? A subflow is a flow with no Input nodes. Rather, a subflow has InputTerminals.
_________________
http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER
Back to top
View user's profile Send private message Send e-mail
Hulisan08
PostPosted: Tue Apr 03, 2012 5:47 am    Post subject: Reply with quote

Newbie

Joined: 03 Apr 2012
Posts: 6

[quote="lancelotlinc"]"Subflow starts with FileInput node"? A subflow is a flow with no Input nodes. Rather, a subflow has InputTerminals.[/quote]
I meant, i cannot have an InputTerminal in this subflow. The subflow should get triggered as soon as the tempFile gets copied to a temp Location.
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue Apr 03, 2012 5:50 am    Post subject: Re: Sub Flow without Input Node Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

Hulisan08 wrote:
During the processing, the source file should not be touched, as this would be used by other process for further processing. hence i used a java compute node to copy the file in temporary folder for my processing.


The FileInputNode is going to touch the file by moving it to the mqsitransitin directory; you can't and shouldn't interfer with this process. If you want a copy of the input store it in the flow not in a temporary file; that's a lot of work & I/O for no good reason.

Hulisan08 wrote:
I have used a routenode, which would read the request parameters and copy the right file.


What request parameters? From the web service? You're trying to read these files on demand but leave them in place? See my earlier comments on the FileInput node.

Hulisan08 wrote:
Subflow starts with FileInputNode, reads the temp file, forms the MRM and using Mapping node, transform it into XMLNSC and return to the main flow with the data in XMLNSC format.


I'm still getting a bad feeling about this.

Hulisan08 wrote:
Issues that i am facing:


I bet you are.

Hulisan08 wrote:
1> Without explicit input node, i am not sure how to link the Main flow with this sub flow


A subflow needs an explicit Input node; typically it's not any of the externally facing ones but the one in the toolbar for sub flows.

Hulisan08 wrote:
2> how to get the XML data in the main flow, which is required for my webservice response?


By passing it back in the message tree to the main flow.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
McueMart
PostPosted: Tue Apr 03, 2012 5:52 am    Post subject: Reply with quote

Chevalier

Joined: 29 Nov 2011
Posts: 490
Location: UK...somewhere

Quote:
"Subflow starts with FileInput node"? A subflow is a flow with no Input nodes. Rather, a subflow has InputTerminals.


Subflows are able to contain InputNodes just fine. My understanding is that a subflow is just a method of encapsulating a set of nodes. At run time the whole flow is 'flattened' and it is transparrent as to whether you had Input nodes in your subflow or otherwise.

As for the OP's query: I believe you just want to look at 'Input' and 'Output' nodes (see the Construction drawer) for passing control into/out of a subflow.
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue Apr 03, 2012 5:54 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

Hulisan08 wrote:
I meant, i cannot have an InputTerminal in this subflow. The subflow should get triggered as soon as the tempFile gets copied to a temp Location.


Ok, that's not a sub flow. That's a 2nd main flow. And I still question this design.

Though I now see why you can't get the XML back into the "main" flow. If we stick with this rather dubious design, you could try having the "sub" flow write the XML out as a 2nd temporary file & using that file as input to the response.

But that's just contact admin. It sounds a lot like you're trying to bend WMB in a direction it's not designed to bend in.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
Hulisan08
PostPosted: Tue Apr 03, 2012 5:57 am    Post subject: Reply with quote

Newbie

Joined: 03 Apr 2012
Posts: 6

Thanks for the response.

This flow would be used for development purposes only. Actual flow would be using the file and process it further.

As this is a new development which requirs interfacing with other teams, Analysts needed a mechanism to read the file. Hence this "Not so good" mechanism of creating a temporary file.

Now, regarding the webservice input, User has an option to choose which of the 3 type of files he want to see, and we would be picking that file for processing.
Back to top
View user's profile Send private message
lancelotlinc
PostPosted: Tue Apr 03, 2012 5:58 am    Post subject: Reply with quote

Jedi Knight

Joined: 22 Mar 2010
Posts: 4941
Location: Bloomington, IL USA

McueMart wrote:
Quote:
"Subflow starts with FileInput node"? A subflow is a flow with no Input nodes. Rather, a subflow has InputTerminals.


Subflows are able to contain InputNodes just fine. My understanding is that a subflow is just a method of encapsulating a set of nodes. At run time the whole flow is 'flattened' and it is transparrent as to whether you had Input nodes in your subflow or otherwise.

As for the OP's query: I believe you just want to look at 'Input' and 'Output' nodes (see the Construction drawer) for passing control into/out of a subflow.


No, subflows do not contain InputNodes. Subflows can have Get nodes, but not InputNodes. Subflows start with InputTerminals not InputNodes. Perhaps we should have a classroom refresher.
_________________
http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER
Back to top
View user's profile Send private message Send e-mail
Vitor
PostPosted: Tue Apr 03, 2012 6:01 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

Hulisan08 wrote:
This flow would be used for development purposes only. Actual flow would be using the file and process it further.


Ah.

Hulisan08 wrote:
As this is a new development which requirs interfacing with other teams, Analysts needed a mechanism to read the file.


So you build the flow as it's supposed to work eventually, and add a leg to it which tests to see if it's running in development and dumps out a human readable copy of the file for the analysts' use. You don't want one flow in development and another moving up.

Hulisan08 wrote:
Now, regarding the webservice input, User has an option to choose which of the 3 type of files he want to see, and we would be picking that file for processing.


Now all you need is a webservice that picks up one of the output files based on input and displays that. I put it to you that this is a task better fitted to a platform other than WMB; I know that WESB can do this sort of thing standing on it's head. I imagine (or could be deluded to believe) that a POJO running someplace could probably pull this off without getting you tied in knots the way WMB will to do this.
_________________
Honesty is the best policy.
Insanity is the best defence.


Last edited by Vitor on Tue Apr 03, 2012 6:02 am; edited 1 time in total
Back to top
View user's profile Send private message
McueMart
PostPosted: Tue Apr 03, 2012 6:02 am    Post subject: Reply with quote

Chevalier

Joined: 29 Nov 2011
Posts: 490
Location: UK...somewhere

You can create a flow, lets call it X.msgflow, which contains an Input Node. You can then use X in another flow, Y, and in this flow, it will be called 'Subflow X'. So im not understanding why you are stating that a subflow can't contain Input Nodes.

I can see no mention of this technical definition here either: http://publib.boulder.ibm.com/infocenter/wmbhelp/v8r0m0/index.jsp?topic=%2Fcom.ibm.etools.mft.doc%2Fac00370_.htm&resultof=%22subflow%22

The evidence im seeing isnt agreeing with what you are stating but please prove me otherwise.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Tue Apr 03, 2012 6:02 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

lancelotlinc wrote:
No, subflows do not contain InputNodes. Subflows can have Get nodes, but not InputNodes. Subflows start with InputTerminals not InputNodes. Perhaps we should have a classroom refresher.


Yes. Let's.

If I wire up a flow as follows:
FileInput--+
Input------+----(in)Compute --- Output

Is this a subflow? Or a main flow?

If I drag and drop this flow onto another flow, and wire the In terminal of the icon represented (that has an in terminal and an out terminal) to the out terminal of an MQInput node, then what do I have?

I have a flow that reads messages via MQ and via a file. It then routes both messages to the same Compute node. This flow uses a subflow.

Lesson Over.
Back to top
View user's profile Send private message
lancelotlinc
PostPosted: Tue Apr 03, 2012 6:05 am    Post subject: Reply with quote

Jedi Knight

Joined: 22 Mar 2010
Posts: 4941
Location: Bloomington, IL USA

I'll concede to your points. This would be a hybrid. Like a car that uses both gasoline and electricity to drive it. But it works.

Don't forget to put Trace nodes in.
_________________
http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER
Back to top
View user's profile Send private message Send e-mail
Esa
PostPosted: Tue Apr 03, 2012 6:06 am    Post subject: Reply with quote

Grand Master

Joined: 22 May 2008
Posts: 1387
Location: Finland

McueMart wrote:
Quote:
"Subflow starts with FileInput node"? A subflow is a flow with no Input nodes. Rather, a subflow has InputTerminals.


Subflows are able to contain InputNodes just fine.


EDIT: this is addressed to the OP (Hulisan08):

Yes, a subflow with a FileInput node as the input node is possible. But the physical input nodes (not the 'Input' node) are nodes that launch a new instance of a message flow. Your flow can be launched by either the SOAPInput or HTTPInput node or the FileInput node in the subflow.

So the FileInput node will launch another instance of the flow. There is no way you can combine the instance threads. You should consider using FileRead node instead. Or write the message from FileInput node into a queue and read it in the main flow with MQGet node. For that you will need some kind of correlation.


Last edited by Esa on Tue Apr 03, 2012 6:24 am; edited 2 times in total
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue Apr 03, 2012 6:19 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

lancelotlinc wrote:
This would be a hybrid. Like a car that uses both gasoline and electricity to drive it. But it works.


It also gets great mileage & may save the world.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
lancelotlinc
PostPosted: Tue Apr 03, 2012 6:29 am    Post subject: Reply with quote

Jedi Knight

Joined: 22 Mar 2010
Posts: 4941
Location: Bloomington, IL USA

Quote:
A subflow can be executed by a broker only as part of the message flow in which it is embedded, and therefore cannot be independently deployed.


This statement does not hold true for hybrids. The moment you break the pure definition of a subflow, that hybrid flow can be independently deployed.
_________________
http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Goto page 1, 2  Next Page 1 of 2

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Sub Flow without Input Node
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.