Author |
Message
|
shashivarungupta |
Posted: Mon Sep 29, 2014 12:10 pm Post subject: Dynamically Mapping To Dynamic Message Assembly at RunTime ? |
|
|
 Grand Master
Joined: 24 Feb 2009 Posts: 1343 Location: Floating in space on a round rock.
|
Hi,
It's related with Mapping Node and the Message Assembly. (MB v8.0.0.4)
In the scenario, where input message assembly needs to get dynamically mapped with dynamic output message assembly.
I understand the fact that for mapping node, input and output message assembly or the schema should be known to broker, to get them mapped as per the requirement (Move/Custom ESQL etc..etc) for transformation.
But if the output message is getting generated dynamically (with dynamic fields/elements in it), to which output message assembly needs to be mapped, How this can be achieved?
Infocenter gives the following link, about 'Dynamically selecting the Message Map' but not the 'Message Assembly'.
Any suggestion ?
 _________________ *Life will beat you down, you need to decide to fight back or leave it. |
|
Back to top |
|
 |
kimbert |
Posted: Mon Sep 29, 2014 12:13 pm Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Please give a specific example of what you mean. The word 'dynamically' means different things to different people. _________________ Before you criticize someone, walk a mile in their shoes. That way you're a mile away, and you have their shoes too. |
|
Back to top |
|
 |
martinb |
Posted: Mon Sep 29, 2014 12:46 pm Post subject: |
|
|
Master
Joined: 09 Nov 2006 Posts: 210 Location: UK
|
More clarity on what you want to achieve is needed, but one point worth mentioning is that within a Graphical Data Map you can use the "Add output" action button to add multiple target/output Assemblies - each of which might specify a different message from one or more message models.
Now you can use If/Else or other conditional transforms to test content of input message and build one or other Output Message Assembly.
The output of the If/Else would be wired to the head of the required Message Assembly so that the Message Map emits one or other output assembly |
|
Back to top |
|
 |
shashivarungupta |
Posted: Mon Sep 29, 2014 1:12 pm Post subject: |
|
|
 Grand Master
Joined: 24 Feb 2009 Posts: 1343 Location: Floating in space on a round rock.
|
kimbert wrote: |
Please give a specific example of what you mean. The word 'dynamically' means different things to different people. |
Okey !! ( 'Dynamic' means, the 'Dynamic' Output Message Assembly where output fields are not known or vary almost every time. Output message can have one or more fields in it. )
For example, My Input Message Assembly is known and having certain fields in it, always !
as:
Code: |
<person>
<name></name>
<age></age>
<address>
<line1></line1>
<suburb></suburb>
<city></city>
</address>
<phone></phone>
</person>
|
And the output message assembly need to be mapped with output message (that's getting formulated by some external source, may be) , that can have any field in it (three sets of examples are mentioned , but these fields can vary in terms of names and cardinality which is not certain.).
1.
Code: |
<personidentity>
<name></name>
<age></age>
<address>
<line1></line1>
<suburb></suburb>
<city></city>
</address>
<phone></phone>
<gender></gender>
<married></married>
<saperated></saperated>
<single></single>
<children>
<name></name>
</children>
<children>
<name></name>
</children>
<children>
<name></name>
</children>
</personidentity> |
2.
Code: |
<citizen>
<firstname></firstname>
<middlename></middlename>
<lastname></lastname>
<spouse>
<name></name>
<age></age>
<alive></alive>
</spouse>
<car>
<insured></insured>
<numberplate></numberplate>
<caridentity></caridentity>
<make></make>
<model></model>
<owner></owner>
</car>
</citizen> |
3.
Code: |
<citizen>
<firstname></firstname>
<middlename></middlename>
<lastname></lastname>
<insurance>
<name></name>
<age></age>
<alive></alive>
<insurancenumber></insurancenumber>
<active></active>
<period></period>
<nominee></nominee>
</insurance>
<nominee>
<name></name>
<age></age>
<alive></alive>
</nominee>
<nominee>
<name></name>
<age></age>
<alive></alive>
</nominee>
</citizen> |
If I know that ONLY 3 or 5 or 10 or some feasible number cases are here in which Output can be formed, I would create those Output Message Assembly Schemas and have set them up as per 'Dynamic Mapping Selection' based on some criteria Or field value.[/code] _________________ *Life will beat you down, you need to decide to fight back or leave it. |
|
Back to top |
|
 |
mqjeff |
Posted: Mon Sep 29, 2014 1:16 pm Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
So how are you supposed to know which structure to create on the output, if it's not dependent on some condition in the input?
If it is dependent on some condition in the input, then you can create models that match the range of inputs you expect to receive.
You likely already have XML schemas that define all of the possible output structures as choices or xs:any fields or etc. You can then use the cast and etc. functions of the map to determine which part of the output schema gets built from. |
|
Back to top |
|
 |
shashivarungupta |
Posted: Mon Sep 29, 2014 1:29 pm Post subject: |
|
|
 Grand Master
Joined: 24 Feb 2009 Posts: 1343 Location: Floating in space on a round rock.
|
mqjeff wrote: |
So how are you supposed to know which structure to create on the output, if it's not dependent on some condition in the input? |
Yup, you're correct. And that's the concern, for which I've been looking for the wayout., this question has got an answer in it as well, which I do feel.
thanks !!
 _________________ *Life will beat you down, you need to decide to fight back or leave it. |
|
Back to top |
|
 |
mqjeff |
Posted: Mon Sep 29, 2014 1:38 pm Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
There are cases where the structures you have to create are dependent on the context of the input - for example destined for customer A rather than customer B. And you need to go to a database or etc. to look up which customer some piece of the input belongs to, and then the format that customer A wants, or the format that customer B wants.
But it's still a matter of "your flow doesn't have to make any random guesses".
Although I suppose at some point, there will be a version of IIB that ships with a WatsonDecisionSupport node.... |
|
Back to top |
|
 |
shashivarungupta |
Posted: Mon Sep 29, 2014 2:01 pm Post subject: |
|
|
 Grand Master
Joined: 24 Feb 2009 Posts: 1343 Location: Floating in space on a round rock.
|
mqjeff wrote: |
There are cases where the structures you have to create are dependent on the context of the input - for example destined for customer A rather than customer B. And you need to go to a database or etc. to look up which customer some piece of the input belongs to, and then the format that customer A wants, or the format that customer B wants.
But it's still a matter of "your flow doesn't have to make any random guesses". |
 _________________ *Life will beat you down, you need to decide to fight back or leave it. |
|
Back to top |
|
 |
|