BizTalk xml file to a flatfile format - biztalk

Relatively new to BizTalk; I could use seasoned help.
I'm faced with having to try to map a source XML document to a flat-file TAB delimited destination. My source document has some nested nodes that I need to iterate through and translate them each as a row on the flat-file document; classic sales order header/detail relationship. The results would need me to repeat the header information for every nested element in the child node.
I've tried a solution using a looping functoid but I'm not sure how to represent the destination list correctly. Am I missing the obvious? At what destination row element should I link my "Looping" output param to?
For demonstration sake here's an example of the schemas I'm working with.
SOURCE SCHEMA (Don't have the possibility to modify the source structure)
schema\
salesorders\
salesorders\orders\
orders\soid
orders\cust name
orders\address
orders\detail\
orders\detail\msrp
orders\detail\modelno
orders\detail\sku
DESTINATION SCHEMA
schema\
\root\
soid
custname
address
etc...
Flat file OUTPUT (One line per detail item)
soid custname address msrp modelno sku
soid custname address msrp modelno sku
Anybody could orient me in right direction?

You'll link your Looping Functoid from the source node you want to have generate a new record to (usually) the outer-record node (usually first child of the Root, but not always) of the destination. This will basically tell the map "Every time you see a new blah in my source, create a whole new record in my destination."

Related

How write collection columns values to columns in table in word document in blueprism

I am working in blueprism and I have to loop through a collection to write back certain columns in the collection to a word file (using Business Object: MS Word VBO, and Action: Type Text). The current setup writes the collection columns values at the beginning of the word file. I would like to have those collection columns to be written in a specific table that already exists in my word template file. How can I achieve that?
Current process:
enter image description here
The current way the collection column values are written in word file:
enter image description here
I tried Set Table Cell Value and it solved my problem.

What are the possible values for the duplicaterecords attribute in armx files

I'm looking to automate an import to remedy ARS 8.1, and I'm 99.9999% there... I just need to change what the import does with duplicate records, as everything else seems to be working exactly as desired.
In remedy armx files (mapping file for the dataimporttool), there is a <datahandling> node with a duplicaterecords attribute, the only documentation I can find on it mentions the value GEN_NEW_ID, which would logically map to the "Generate New ID for Duplicate Records" option in the GUI import tool. I need the value to logically map to the "Update Old Record with New Record's Data" GUI option (both of these options and the other three possible options are described on the Defining Data Import preferences page in BMC docs.
Other than that one page (Importing in...), and the several local versions of the exact same paragraph in all the remedy documentation I have, Google turns up nothing. Please tell me someone has this information somewhere!
By saving .armx files from the GUI, I have found the following options and values for the duplicaterecords attribute in the <datahandling> tag.
Title Value in .armx file
Generate New ID for All Records GEN_NEW_ID
Reject Duplicate Records DUP_ERROR
Generate New ID for Duplicate Records DUP_NEW_ID
Replace Old Record with New Record DUP_OVERWRITE
Update Old Record with New Record's Data DUP_MERGE

Lookup field appears as numerical values instead of text on Access report

I am trying to create a report putting a field called contact which has the name of a person. This name is linked directly to another table where I keep all the contacts.
For some strange reason, when I include this name (which in query view displays as the name of the contact), instead of the name appearing, the unique ID number is shown on my report.
As mentioned in the article cited in the above comment, you can use a Combo Box control on your report to do the lookup for you. To see how this can be done, create a new report based on the table containing the lookup field, then drag and drop that field onto the report. That will create a Combo Box control with properties that look something like this:
Row Source: SELECT [Clients].[ID], [Clients].[LastName] FROM Clients;
Bound Column: 1
Column Count: 2
Column Widths: 0";1"
You could use a similar Combo Box control on your actual report to display the client's name rather than their numeric ID value.
Another alternative would be to change the Control Source of the report's Text Box control to have it do a DLookUp() on the table. If the lookup field is named [client] then changing the Control Source of the Text Box to something like
=DLookUp("LastName","Clients","ID=" & [client])
would also work.
I wanted to add to the great answer by Gord:
When using a "web" database (started in Access 2007 I think), you cannot change a report's fields to ComboBox style, nor can you use DLookUp(). (web databases lack a ton of features)
The workaround for this, if you want to create a Web-Report that uses lookup fields, is to create a Web-Query first based on your Web-Table (all the Web-* stuff has a www planet icon over the logo, if you create a new Web-DB in Access 2007+ you'll see what I mean)
So, instead of Table -> Report, you'll have to do W-Table -> W-Query -> W-Report.
Then, the only thing you need to customize to get the data right is the W-Query. Start by trying to reproduce the look in the query to match what you want users to see in the report. Note that here in the query, lookups will work fine (instead of the unique ID's, you get field names like you want). However, this will not carry over to the report. To do that, you gotta get the actual text field name you want into the query:
You should already have one table in your query; start by adding the table that your first lookup field points to. For example, the table I want to print is called Stock_Boards, and it has a lookup field called PCBID_lookup that points to the table Stock_PCBs.
Since you're using lookup fields, there should already be a relationship line between the two tables when you add the second one. If there isn't, something has gone horribly wrong.
Now, see how that line connects two fields on the two different tables? For example, I've got my PCBID_lookup field on my Stock_Boards table, which connects to the ID field on my Stock_PCBs table. If I created a report from this now, PCBID_lookup would be a number, a number that correlates to the ID of a record on Stock_PCBs.
To fix it, I will add the name field I want to show up on the report. In my example, that happens to be a Part Number, rather than the ID. I add the PartNumber field from my Stock_PCBs table to the query, and remove the PCBID_lookup field of the Stock_Boards table from my query.
Since PartNumber is what I want to show up on my report, it effectively replaces the original field (PCBID_lookup)
Repeat for all lookup fields you want in your report.
I had 1 more: I removed the Status field of the Stock_Boards table (which was an ID/Lookup) and added the 'Status' field from the Status table (which was the actual text name)
When finished, your query should look exactly how you want the data to appear, without any special tricks or asking Access to do something unnatural. Save your query, and create a web-report from it. Done!

Can't suppress nodes in BizTalk mapping

Afternoon all,
I'm learning BizTalk and am stuck on this problem.
There's a choice group with either telephone or address.
I can get the some of the address fields to be suppressed when outputting the telephone.
To make things simpler I'll just discuss the "CityName" field .
I've tried the following:
Mapped the "City" (text) node in the input file to "CityName" in the output. Connected an Exists logical functoid to the "Address1" node in the input node and the "CityName" in the output. I always get a city name with text filled in.
Mapped the "City" node in the input file and the Exists logical functoid to a Value Mapper functoid. Connected the Value Mapper functoid to the CityName in the output. I get a city name in the address node (Correct) and an empty node in the telephone node (Incorrect).
Mapped the "City" node in the input file and the Exists logical functoid to a Value Mapper (Flattening) functoid. Connected the Value Mapper (Flattening) functoid to the CityName in the output. I get a city name in the address node (Correct) and an empty node in the telephone node (Incorrect).
I thought one of the last two should have worked but both give an empty node instead of a suppressed node. The empty nodes have no attributes.
The CityName node is described by this schema type:
<xsd:complexType name="NameType">
<xsd:simpleContent>
<xsd:extension base="xsd:string">
<xsd:attribute name="languageID" type="xsd:language" use="optional">
</xsd:attribute>
<xsd:attribute name="sequence" type="IntegerNumericType">
</xsd:attribute>
<xsd:attribute name="sequenceName" type="StringType" />
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
<xsd:simpleType name="IntegerNumericType">
<xsd:restriction base="xsd:integer" />
</xsd:simpleType>
<xsd:simpleType name="StringType">
<xsd:restriction base="xsd:string" />
</xsd:simpleType>
Is there something in the type definition that's forcing an empty node to be created?
Thanks
EDIT: Below is the incorrect output. The second and third Communication nodes have
an Address Child node and should not.
I have a looping functoid on the phone numbers and the first address line in a flat input schema. That produces the three Communications nodes. I'm using a Logical Existance functoid on the address line to suppress the phone info in the first node. I have a Logical Not functoid on the output of that which is tied directly to the Address node in the output schema. I thought that should turn off the entire address node but it doesn't.
I tried adding a Value Mapping functoid connected to the Logical Existance functoid to the City Name and Postal code elements and that makes them empty, but they just will not go away. ARG!
I checked and the fields are all set to zero MinOccurs and I don't believe they're assigned a default value.
<ns0:Communication>
<ns0:Address>
<ns0:AddressLine sequence="1">1234 My St</ns0:AddressLine>
<ns0:AddressLine sequence="2">Apt. 2</ns0:AddressLine>
<ns0:CityName>Kansas City</ns0:CityName>
<ns0:CountrySubDivisionCode name="State">MO</ns0:CountrySubDivisionCode>
<ns0:CountrySubDivisionCode name="County">Jackson</ns0:CountrySubDivisionCode>
<ns0:CountryCode>US</ns0:CountryCode>
<ns0:PostalCode>64099</ns0:PostalCode>
</ns0:Address>
</ns0:Communication>
<ns0:Communication sequence="1">
<ns0:ChannelCode>Telephone</ns0:ChannelCode>
<ns0:UseCode>Personal</ns0:UseCode>
<ns0:DialNumber>1234567890</ns0:DialNumber>
<ns0:Address>
<ns0:CityName />
<ns0:CountryCode />
<ns0:PostalCode>64099</ns0:PostalCode>
</ns0:Address>
</ns0:Communication>
<ns0:Communication sequence="2">
<ns0:ChannelCode>Telephone</ns0:ChannelCode>
<ns0:UseCode>Business</ns0:UseCode>
<ns0:DialNumber>0987654321</ns0:DialNumber>
<ns0:Address>
<ns0:CityName />
<ns0:CountryCode />
<ns0:PostalCode>64099</ns0:PostalCode>
</ns0:Address>
</ns0:Communication>
It would help to have sample input and output xml snippets. Without that, I can guess at the xml structures. If they look something like this, then the below mapping should work fine:
Do your schemas look like that? The output produced by such a map is valid IF the <Choice> in the destination schema is set to Max Occurs = unbounded. If that's not the case, and if you can only have one Contact output, then you would have to only output the Phone if the Address is not there, like this:
Of course, that seems a bit silly, since one would expect to have both an Address and a Phone in the source xml, and the destination xml prevents you from having both.
If none of these scenarios matches up with yours, then please edit your question to provide more details.
The min & max occurrences on the schema defaults to 1. The mapper looks at that when generating the XSLT. Try setting Min Occur to 0.
The way to solve this issue is to use xsl directly instead of the built in mapper.
With xsl you can control when and how values are selected. That's very difficult
when using multiple looping functoids.

How to set a default value to an destination schema element in BizTalk Map

I have a requirement in BizTalk map, where
I will map some elements from source schema to destination schema,where the values will be assigned to destination schema elements based on some condition.
If those values are not assigned, i need to send some default value (N/A).
My map is not One-to-One so that i can use a scripting functoid and send a default value, on top of that the destination schema is a flat file and in source schema i have to loop a lot.
So can any body give me some suggestion about "How to set a Default value to a Element in Destination schema if nothing is mapped" using BizTalk Map/some setting in schema.
What I have already tried is, I Opened the destination schema for all the elements I have set the value 'N/A' to a property -> "DefaultValue" which was there in the property tab but when nothing is mapped the default value is not coming. Instead the node itself is not created in the Output file.
Please see the Map below for a good understanding
alt text http://www.biztalkgurus.com/cfs-filesystemfile.ashx/__key/CommunityServer.Discussions.Components.Files/13/0131.problem.JPG
Source Schema is a XML schema.
Destination Schema is a Flat file schema.
Now in the above map, in my source schema I am having a node called F4706 which will loop.
When the element "TypeAddressNumber" within the F4706 is "1", then I am mapping the remaining fields of that F4706 instance to "ship to" details in my destination schema
When the element "TypeAddressNumber" within the F4706 is "2",then I am mapping the remaining fields of that F4706 instance to "Reseller" details in my destination schema
When the element "TypeAddressNumber" within the F4706 is "3",then I am mapping the remaining fields of that F4706 instance to "EndUser" details in my destination schema
Now if I connect a Logical NOT functoid to the Logical Equal functoid and assign some default value, then the my destination node occurs Three times as one time the "=" functiod returns true one time and false other two times. But what I want is, if anything is there to map then map from "F4706" instance or assign the default value.
Find the INPUT File below
alt text http://www.biztalkgurus.com/cfs-filesystemfile.ashx/__key/CommunityServer.Discussions.Components.Files/13/5430.ip.JPG
The output I'm expecting and getting is :
alt text http://www.biztalkgurus.com/cfs-filesystemfile.ashx/__key/CommunityServer.Discussions.Components.Files/13/0724.curOP.JPG
Now if the Input file is like below :
alt text http://www.biztalkgurus.com/cfs-filesystemfile.ashx/__key/CommunityServer.Discussions.Components.Files/13/6403.otherIP.JPG
That is when I don't have a "F4706" node with TypeAddressNumber=2, I need to fill "N/A" in Reseller related nodes in my destination schema, which should look like below :
alt text http://www.biztalkgurus.com/cfs-filesystemfile.ashx/__key/CommunityServer.Discussions.Components.Files/13/0435.nextOP.JPG
If you go and check the XLST which is getting generated, it is writing a xsl:foreach so if you use xsl:choose/otherwise conditions gets checked multiple times and my output nodes gets duplicated.
I also tried to use some global variable in XLST in First Loop and and second loop to access that and write the default value, unfortunately it doesn't work too. Because a VARIABLE in XLST is not a TRUE variable. I think its a CONSTANT.
How to accomplish this ANY help is highly appreciated.
Put two "Value mapping" (Label them "Incoming" and "Default") on the map and drag the output from both to your destination (you will get a warning at compile time).
Put a "Logical NOT" on the map (Label it "NoValue").
Put a logical evaluation (Existence, IsNil, Length) that suits your need, to evaluate if you have an incoming value, and drag your source field to it. (Label it "HasValue")
Drag the result to the "Incoming" and the "Logical NOT".
Drag your source field to the "Incoming".
Drag the output from "NoValue" to "Default".
Add a constant parameter to "Default", by double clicking and insert new parameter, that is your default value.
Hope you understand this mess :)
I believe you are essentially trying to control the creation of an output node based on some condition.
I have tried this for records (you are trying to do this for elements, so I believe this should work for that as well).
I had connected the output of the Logical functoid to the record and the record was created only if the logical functoid returned true.
For default values, you are doing it the right way by putting the default value in the property grid for Schema element. So if nothing is mapped to this element, you will see in the xsl file that the element with the default value is generated.

Resources