You are not logged in.
Announcement
Unanswered posts
|
For us having the option to create different multiple output on different connections is important. Our usecase is that we get a java result class that contains two unrelated arrays with results. We wanted to output each array on it's own connection.
The multi dimensional output is when nested loops are used. This is currently impossible, as Talend always only creates only one closing "}". You deduced that one correctly.
lwerzinger, thank you for your feedback. I'm sure we can improve the IS_MULTIPLYING_OUTPUTS option.
I think I understand what you mean (ie "for () { for () {") bu can you give some examples of multiple dimensions generated code?
Do you also mean that on a single component, you have several output connections, and one some of them you want IS_MULTIPLYING_OUTPUTS activated?
From topic:4896, I move this interesting discussion to a new topic because it is a bit "off topic" and I think it deserves a dedicated topic :-)
lwerzinger wrote:
Besides that, let me share some recent experiences I made creating components.
I wanted to create a component that creates multiple output rows per input row
(in more than one output connection. Here's what I found:
1. It was incredibly hard to find out how multiple output rows per input row
are handled in talend, as reading existing code for e.g. parseXmlRow did not
reveal the secret. After asking Parham he pointed me to set the "magic" XML
attribute and told me to create a loop without ending brace. It still took a
long time before I understood the "concept" behind it.
2. Starting to play with that information I quickly realized that the way
Talend currently handles multiple output rows is severely limited, as the
components downstream are "inserted" into that "unclosed" loop and Talend
magically closes the loop:
* you can only iterate over one dimension
* you can only use it for one output connection
My recommendation to overcome this limits is to add new attributes to the
connection:
1. an attribute to the connection that tells Talend that multiple output rows
are to be created and how deep the nesting is.
This removes the limit of one dimension as Talend can create as many closing
braces as needed.
2. an attribute that specifies the jet template name for the code to generate
for this connection. The name could be automatically derived from the
connection name and this attribute may not be needed.
The use of a separate jet template per connection removes the limit that only
one connection can be used with multiple output rows.
These changes are additive and can be introduced with no harm to newer
versions of Talend.