IMPORTANT:
this is not a Support Forum! Experienced users might answer from time to time questions posted here. If you need a professional and reliable answer, or if you want to report a bug, please contact Altova Support instead.

Profile: DBNewbie_2007
About
User Name: DBNewbie_2007
Forum Rank: Advanced Member
Real Name:
Location Pittsburgh, PA, USA
Occupation:
Interests:
Gender: None Specified
Statistics
Joined: Thursday, September 9, 2010
Last Visit: Wednesday, June 1, 2022 5:06:55 PM
Number of Posts: 51
[0.28% of all post / 0.01 posts per day]
Avatar
Last 10 Posts
Topic: Microsoft .NET Core Support
Posted: Wednesday, June 1, 2022 4:37:37 PM
Does Altova MapForce/code generation support .NET CORE yet? When compiling C# code, I only have options to use .NET Framework versions (Visual Studio 2019). When I create a new console app from scratch in Visual Studio, the default is .NET CORE 5...

If not, are there any plans to support the .NET CORE? It appears that .NET Framework may not have any more updates/development past 4.8.x.
Topic: System.OutOfMemoryException
Posted: Tuesday, March 25, 2014 12:51:56 PM
We experienced an interesting problem recently that I wanted to document here in the forums, in case someone else runs into this issue.

A few years back, we discovered that we could only process any EDI X12 files, 50MBytes or larger, using a 64-bit system, as a 32-bit system threw memory errors.

Recently, we received a EDI X12 file 759MBytes in size. Here is the error we experienced when trying to run it on various 64-bit systems (mapping was done using MapForce 2012 R2 SP1):

ERROR: Error while trying to read from stream
Inner Exception: Exception of type 'System.OutOfMemoryException' was thrown..

Stack Trace:
at Altova.TextParser.EDI.TextDocument.Parse(Stream stream)
at Altova.TextParser.EDI.TextDocument.Parse(Input input)
at Mapping.MappingMapToEDI110_4060_FedEx2.Run(Input EDI110_4060_FedExSource, String EDI110_4060_FedEx2TargetConnectionString)
at Mapping.MappingConsole.Main(String[] args)


• Installed MapForce 2014 SP2.
- Compiled application in C# with VS 2005 as the target, with Platform set to X64 (instead of Any CPU)
* Result: Still received the memory error.
- Compiled application in C# with VS 2010 as the target, with Platform set to X64 (instead of Any CPU)
* Result: compiled console app worked on my desktop, but consumed too many resources. Killed process, transferred it to a new 2012 server with 128 G RAM. The compiled application took 18.4 - 19.2 GBytes of RAM to run, 15 hours to process.

• MapForce 2012 R2 SP1.
- Compiled application in C# with VS 2010 as the target, with Platform set to X64 (instead of Any CPU)
* Result: Console app worked again.

• MapForce 2012 R2 SP1 application GUI.
* Result: File appeared to process fine, just took a lot of system RAM.

Interesting that is was not the version of MapForce what appeared to be the problem, but rather the target used for the compiled code (VS 2010 versus VS 2005). Note, for our usage, we compile the C# code for use in an "EDI Reader" application. We write to 14 SQL Server tables; MS SQL server is anything from 2005 to 2008R2.

Good luck and happy programming! :)

Topic: Assembly Version Control
Posted: Friday, January 3, 2014 3:55:56 PM
I sent this message to Altova Support, but I thought I would also ask it here in the forums as well:

Is there a way to control the assembly version (other than file comparisons) when generating C# code from an Altova MapForce mapping/project in the GUI? In other words, when generating code from the Altova Mapforce GUI (FILE -> GENERATE CODE IN -> C#), is there a way to set the assembly version for the various Class Libraries that get re-generated each time,

Altova
AltovaDB
AltovaFunctions
AltovaText
AltovaXML
Mapping
X12_Envelope
X12_Envelope2

Also, is there a way to know when the "standard" class libraries,
Altova
AltovaDB
AltovaFunctions
AltovaText
AltovaXML

do not need a new version (again, other than a file comparison)?

Thanks! :)
Topic: namespace generation
Posted: Friday, December 20, 2013 8:55:56 PM
I do not believe you have the ability to easily change the name of that namespace. It is generated based on the EDI library you are using. You do have control over other library names by providing unique component name(s) to the input and output sources.

I believe the X12_Envelope is a generic class and generates a standard/generic dll that should be available to multiple mappings. Are you trying to put individual mappings into the same application directory?

Our "projects" and subsequent code consists of multiple mappings combined together into one executable. We use a GUI front end to call the specific mapping.
Topic: force EDI segment/element to appear
Posted: Friday, December 20, 2013 8:45:14 PM
Here is a new mapping where I am using a "substitute null" function.

Output from the mapping:

ISA+00+ +00+ +ZZ++ZZ++131220+1535+ +00401+000000000+1+P+:'
GS++++20131220+15350872'
ST+110+ '
B3'
N1'
N9+B3+12345++20131220++ET+B '
N9+IT+67890++20131220++ET+B '
LX'
L5'
L3'
SE+9+ '
GE+1'
IEA+1+000000000'

Notice the N9 segments now have values where there were NULLs before.

Topic: force EDI segment/element to appear
Posted: Friday, December 20, 2013 8:41:37 PM
Here is a mapping that is a "straight through" (extract data from a database and create an EDI file). Here is my database structure:

CREATE TABLE [dbo].[N9Table](
[RowNumber] [bigint] NOT NULL,
[ReferenceQualifier] [varchar](3) NOT NULL,
[ReferenceDesc] [varchar](70) NOT NULL,
[FreeFormDesc] [varchar](50) NULL,
[RefDate] [smalldatetime] NULL,
[TimeCode] [varchar](2) NULL,
[ReferenceID] [varchar](2) NULL,
) ON [PRIMARY]

INSERT INTO dbo.N9Table
SELECT '1', 'B3','12345','',NULL,NULL,NULL UNION
SELECT '2', 'IT','67890','',NULL,NULL,NULL

Here is the output from the mapping, which is not putting values into the "missing" files for the N9 segments:

ISA+00+ +00+ +ZZ++ZZ++131220+1543+ +00401+000000000+1+P+:'
GS++++20131220+15431284'
ST+110+ '
B3'
N1'
N9+B3+12345'
N9+IT+67890'
LX'
L5'
L3'
SE+9+ '
GE+1'
IEA+1+000000000'

Topic: throw conditional exception?
Posted: Wednesday, August 28, 2013 3:45:39 PM
ultrabeet wrote:
DBNewbie_2007,

in my opinion you are overcomplicating the mapping...

anyway, you should be able to use variables


I am always willing to learn new things. If you have some suggestions or examples, I would love to hear or see them?

My logic was as follows (built into a function):
1. Check if it is numeric.
YES - Pass on.
NO, step 2.
2. Check if it starts with a "-".
YES. strip out the "-" and the spaces, then re-apply the "-" to make it negative.
NO. Throw EXCEPTION

In this particular data, there are 28 fields that need this type of check to pass the data to a database/decimal field(s). ** Note the attachment was updated from the original post 8/28 to an updated file on 8/29 due to some logic problems. **
Topic: throw conditional exception?
Posted: Wednesday, August 28, 2013 3:40:14 PM
Ok... here is a corrected mapping that correctly throws an exception. All I can say is you really have to watch your logic, test the various outputs (note the substitute nulls and if-else!) ** Note the image/map was updated from the original post 8/28 to an updated image/map on 8/29 due to some logic problems. **

Topic: Exception Handling
Posted: Wednesday, August 28, 2013 2:55:32 PM
It would help if the existing "Exception" function would not have the following restrictions:

• Both parameters of the filter component, on-true and on-false, must be mapped! One of them needs to be mapped to the exception component, and the other, to the target component that receives the filtered source data. If this is not the case, the exception component will never be triggered.

• The exception and target components must be directly connected to the filter component. Functions, or other components, may not be placed between the filter and either the exception, or target components.


We want to throw an exception if specific conditions do not apply (i.e., two tests on same data return a "false") but do not want to forward the "true" output from the filter, as per the ExpenseLimit.mfd example. The actual "true" output is handled elsewhere with additional code, so we violate both bullet items above.
Topic: throw conditional exception?
Posted: Wednesday, August 28, 2013 2:51:24 PM
Fast forward to late 2013 and it appears that this functionality has not changed. Per the MapForce 2013 documentation:

• Both parameters of the filter component, on-true and on-false, must be mapped! One of them needs to be mapped to the exception component, and the other, to the target component that receives the filtered source data. If this is not the case, the exception component will never be triggered.

• The exception and target components must be directly connected to the filter component. Functions, or other components, may not be placed between the filter and either the exception, or target components.


We are in the same position as the previous post... we want to throw an exception if specific conditions do not apply but do not want to forward the "true" output from the filter, as per the ExpenseLimit.mfd example. The actual "true" output is handled elsewhere with additional code, so we violate both bullet items above. :(

For my specific example, we are receiving input in a csv/flat file. It is suppose to contain numeric values but they are being passed as strings, i.e., "0.57" and "- 3.16" (note spaces between "-" and the "3", so it does not evaluate as numeric). We want to test the data to see if it is numeric or not, correct and pass the data on if it is or throw an error it the data is alpha, i.e. "abc".

Use of the Altova User Forum(s) is governed by the Altova Terms of Use.