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: Rajkun
About
User Name: Rajkun
Forum Rank: Member
Real Name:
Location USA
Occupation:
Interests:
Gender: None Specified
Statistics
Joined: Wednesday, March 22, 2017
Last Visit: Friday, September 29, 2017 6:09:32 PM
Number of Posts: 10
[0.06% of all post / 0.00 posts per day]
Avatar
Last 10 Posts
Topic: Group by
Posted: Wednesday, August 2, 2017 6:37:08 PM
No it is not working, I tried it it return the count value will be 1.

The below image shows the mapping and result:
https://ibb.co/i4qouk

we can see there are 6 contract Id's so it created 6 <ediOutShipperImbalance> elements as group-by used and I was expecting the count returns 6 as there are 6 different contract id's but I guess at the time of count invoke the scope has only one group available to it.

I'm looking something like below:

Code:
<?xml version="1.0" encoding="UTF-8"?>
<ediDatasetIMBL xsi:noNamespaceSchemaLocation=".../NA.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <ediOutShipperImbalanceList>
        <ediOutShipperImbalance>
            <activityNbr>6</activityNbr>
        </ediOutShipperImbalance>
        <ediOutShipperImbalance>
            <activityNbr>6</activityNbr>
        </ediOutShipperImbalance>
        <ediOutShipperImbalance>
            <activityNbr>6</activityNbr>
        </ediOutShipperImbalance>
        <ediOutShipperImbalance>
            <activityNbr>6</activityNbr>
        </ediOutShipperImbalance>
        <ediOutShipperImbalance>
            <activityNbr>6</activityNbr>
        </ediOutShipperImbalance>
        <ediOutShipperImbalance>
            <activityNbr>6</activityNbr>
        </ediOutShipperImbalance>
    </ediOutShipperImbalanceList>
</ediDatasetIMBL>


Topic: Group by
Posted: Wednesday, August 2, 2017 5:18:18 PM
How exactly does group-by function work?

I have used this function to group based on key and used count on nodes hoping I get number of unique keys count, but it turned out to get different count which is not expected.

The Mapping image:
https://ibb.co/i4iic5

I expected the count return me 4 as there are 4 unique contractId's.
Note: There are other ediOutShipperImbalance nodes which has same contract Id as other ediOutShipperImbalance, but the unique contract Id's are only 4.

Please help me with understanding group-by.

thanks
Topic: Error in java Generated code for Mapping
Posted: Tuesday, August 1, 2017 6:32:47 PM
Can anyone help me with mapping the "hierarchical level"

Code:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<IMBL>
      <ImbalanceList>
        <Imbalance>
            <activityNbr>31</activityNbr>
            <contractId>42737</contractId>
            <flowBeginTime>2017-03-29T09:00:00-04:00</flowBeginTime>
        </Imbalance>
        <Imbalance>
            <activityNbr>44</activityNbr>
            <contractId>42737</contractId>
            <flowBeginTime>2017-03-23T09:00:00-04:00</flowBeginTime>
        </Imbalance>
    </ImbalanceList>
</IMBL>


First I need to create HL node based on group by on contractId ie.,
in above xml I have two imbalance but both has same contractId so I'll group them based on contract id and mapped to LoopHL
https://ibb.co/bGYLqQ

and I created duplicate HL loop after on LoopHL ie., LoopHL (2)
and did group by on active number, which are two different active numbers and mapped them to LoopHL (1)
https://ibb.co/gnY3AQ

And I created another duplicate of HL Loop ie., LoopHL (3) and did group by on already grouped nodes and mapped to LoopHL (3)
https://ibb.co/nFztAQ

Here my question is I need to generate a "hierarchal Id number" and "Hierarchal Parent Id number" , that is
HL^1^^IB~ -------> this represents first HL loop (LoopHL) as there is only one contract ID on entire xml data and it has no parent (HL02) ----- 42737
HL^2^1^9~ -------> this represents first HL Loop for (LoopHL (2)) ----- 31
HL^3^1^9~ -------> this represent another HL Loop for next activity Nbr, but parent(HL02) is same as 1 ----- 44
HL^4^2^IA~ -------> this represent first HL Loop for (LoopHL (3)), parent id of this is 2 ----- 2017-03-29T09:00:00-04:00
HL^5^3^IA~ -------> this represent first HLLoop for (LoopHL (3)), parent id of this is 3 ----- 2017-03-23T09:00:00-04:00

Topic: Error in java Generated code for Mapping
Posted: Tuesday, August 1, 2017 4:23:59 PM
Hi,

I'm trying to map an from XML to X12.
my Configurations are X12.6020, 811- Consolidated Service Invoice/Statement.

In Altova Mapforce I've made a logic where the HL nodes of X12 has proper 'hierarchical ID number'(HL01) and 'Hierarchical Parent ID number'(HL02). This is working in Mapforce, ie., I'm getting an expected output.
Problem: when generating java Code the generate Code has error.

Mapping:
https://ibb.co/jiczzk

Result:
ISA^00^ ^00^ ^ZZ^^ZZ^^170801^1158^ ^00602^000000000^1^P^|~
GS^^^^20170801^115859~
ST^811^ ~
BIG~
HL^1^^IB~
HL^2^1^9~
HL^3^1^9~
HL^4^2^IA~
HL^5^3^IA~
TDS~
SE^9^ ~
GE^1~
IEA^1^000000000~

After debugging a while a realized a specific connection in mapping is causing this problem, below is the image of the connection that is causing problem
https://ibb.co/bYsos5

Java Error Code:

private boolean moveNext_18() throws Exception {
state = 20;
if (!var23_group_by.moveNext()) {state = 19; return false; }
var24_value = new com.altova.functions.Core.SequenceCache((new seq80_map(closure.var7_l0, var22_box)));
com.altova.functions.Core.exists(var24_value);
var25_map = new com.altova.functions.Core.SequenceCache(var24_value);
var26_group_by = (com.altova.functions.Core.groupBy(com.altova.functions.Core.groupItems(((com.altova.functions.Core.Group)(var23_group_by.current()))), (new seq82_box_lambda(closure.var7_l0)))).enumerator();
return false;
}

when trying to create a new object of class seq82_box_lambda showing as error as class seq82_box_lambda doesn't exist in generated code

Please let me know if you need any more information on this topic.

Thanks,
Raj
Topic: Nesting LoopNodes of X12
Posted: Tuesday, March 28, 2017 12:58:12 PM
Hi, once again thanks for your effort on providing the answer to my question.

The information you posted on your last reply was very helpful, many thanks.

Quote:
(I think your sample X12 output was missing the second FlowDate for the second contract's second activity. Also, I changed the "seconds" of all the FlowDates to be unique so it's easier to see at a glance where they ended up.)


It was my mistake, while writing output I thought group by remove duplicate value. My bad, thanks for the catch (I should have used distinct-values library function for that purpose).


I'm able to achieve the required result by you'r suggestions.

Thanks.
Topic: Nesting LoopNodes of X12
Posted: Monday, March 27, 2017 3:12:44 PM
K101 wrote:
1. The mapping you attached uses different schema and instance files. It seems possible to change the mapping to use the ones you attached, so I did that

2. Most likely you need to add the HL hierarchy to the 811.Config itself. MapForce's regular X12 templates don't include the different HL levels for technical reasons. HOWEVER, MapForce's HIPAA X12 configurations use a more advanced format and do. So, you can upgrade the regular X12 6020 811 to use the HIPAA style. Then, you'll have three levels of LoopHL to map to, and that should make it easier for you.

Download these files. Move the 'X12.6020.v4\' folder to 'C:\Program Files\Altova\MapForce2017\MapForceEDI\'. In this upgraded config, I've created three HL levels: "Detail", "Sub-Detail," and "Sub-Sub-Detail". I included only the LoopIT1 sub-substructure within each level. You can easily restore others from the regular X12 6020 811.Config as necessary. (Note also that the previously-optional F734 field has been made mandatory in X12.Segment so it will automatically be completed.)

3. The "Correct" vs. "My" output examples you posted the image of don't appear to contain the same data. It would be helpful to see an example of the desired output using the exact XML input file you attached here. The attached example mapping may or may not be the right starting point for what you want.

Hi, Many thanks for the reply. The information on point 2 ie., "Modifying HL hierarchy" worked perfectly by modifying 811.config file, but I'm not sure if I can change the 811 standard hierarchy as it was agreed standard between me and my partner, although it works perfect for my situation.
I read about non inline functions, which I think could be helpful to get the HL loop hierarchy. If I'm correct on using non inline function, can you help me on how to use functions to get desired HL hierarchy or if there is any another alternate solution for the problem.

And I talked with my partner he is okay with HL hierarchy structure (ie., it can be all Details, followed by all sub-Details, and followed by all sub-sub-Details) as long as the HL loop generates proper sequence ie.,HL01 the sequence and HL02 points the proper parent HL.

and the condition for HL grouping are:

1. The Detail Level HL Loop will occur once for every Requester Contract. The requester contract is unique. So, group all the notices with same contract number.

2. The Sub-Detail Level HL Loop will occur once for every group of activity Number. The Detail HL loop can have multiple activity numbers, which can be repeated or can be different activity number. (group the same activity number into sub-detail HL that are under the detail HL group).

3. The Sub-sub-Detail HL Loop will occur once for every set of flow dates. (under each activity level(sub-detail) group check for flow-date and group them into sub-sub-detail HL loop).

Note: The invoice Object has the values for 'requester contract', 'activity number', and 'flow dates'. The same group of notices has same contract number.

lets say if I've invoice list of as shown below.

Code:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<datasetInvoice>
    <controlNumber>1456</controlNumber>
    <serviceGivenBy>AA Company</serviceGivenBy>
    <serviceTakenBy>BB Company</serviceTakenBy>
    <invoiceList>
        <invoice>
            <activityNbr>1</activityNbr>
            <flowDate>2016-12-13T09:00:00-05:00</flowDate>
            <contractId>1</contractId>
        </invoice>
        <invoice>
            <activityNbr>1</activityNbr>
            <flowDate>2016-12-14T09:00:00-05:00</flowDate>
            <contractId>1</contractId>
        </invoice>
        <invoice>
            <activityNbr>2</activityNbr>
            <flowDate>2016-12-13T09:00:00-05:00</flowDate>
            <contractId>1</contractId>
        </invoice>
        <invoice>
            <activityNbr>1</activityNbr>
            <flowDate>2016-12-13T09:00:00-05:00</flowDate>
            <contractId>2</contractId>
        </invoice>
        <invoice>
            <activityNbr>2</activityNbr>
            <flowDate>2016-12-14T09:00:00-05:00</flowDate>
            <contractId>2</contractId>
        </invoice>
        <invoice>
            <activityNbr>2</activityNbr>
            <flowDate>2016-12-14T09:00:00-05:00</flowDate>
            <contractId>2</contractId>
        </invoice>
    </invoiceList>
</datasetInvoice>


Result should be like:

Code:

HL*1**IB
IT1*1
REF*KSR*1 ------------------------> 1st Contract Number
HL*2*1*9
IT1*2
REF*BE*1~  -----------------------> 1st Activity Number
HL*3*2*IA~
IT1*3~
DTM*405****RD8*2016-12-13T09:00:00-05:00~ ------------> 1st FlowDate
HL*4*2*IA~
IT1*4~
DTM*405****RD8*2016-12-14T09:00:00-05:00~ ------------> 2nd FlowDate
HL*5*1*9
IT1*5
REF*BE*2~  -----------------------> 2nd Activity Number
HL*6*5*IA~
IT1*6~
DTM*405****RD8*2016-12-13T09:00:00-05:00~ ------------> 1st FlowDate
HL*7**IB
IT1*7
REF*KSR*2 ------------------------> 2nd Contract Number
HL*8*7*9
IT1*8
REF*BE*1~  -----------------------> 1st Activity Number
HL*9*8*IA~
IT1*9~
DTM*405****RD8*2016-12-13T09:00:00-05:00~ ------------> 1st FlowDate
HL*10*7*9
IT1*10
REF*BE*2~  -----------------------> 2nd Activity Number
HL*11*10*IA~
IT1*11~
DTM*405****RD8*2016-12-14T09:00:00-05:00~ ------------> 1st FlowDate

Topic: Nesting LoopNodes of X12
Posted: Thursday, March 23, 2017 5:27:47 PM
K101 wrote:
Instead of pictures, please just attach your actual files. Then we have something we can actually work with rather than merely look at.

If your files are sensitive in some way, either contact Altova Support directly, or create a copy of your input data which is not sensitive.


I've attached the files. The attached are sample (Where data is altered in schema file as it is sensitive). And on mfd file I got stuck while mapping LoopHL that can represent the X12 output in correct structure for LoopHL segment/node.
Topic: Nesting LoopNodes of X12
Posted: Thursday, March 23, 2017 12:38:40 PM
Hi everyone, I'm new to Altova Correct me if I'm wrong.

I'm in a situation to map XML schema File to X12 and here I have a problem to get the actual X12 structure.

Requirements:
X12.6020 - 811 (Consolidated Service Invoice/Statement)
The Contract Level (Detail) HL Loop will occur once for every ContractId.
The Activity Level (Sub-Detail) HL Loop will occur once for every activityNbr.
The Flow Dates/Quantity (Sub-Sub-Detail) HL Loop will occur once for every set of flow dates.

Picture of the Actual X12 Structure and My mapped X12 Structure
https://ibb.co/cWFBAa


Picture of the XML file
https://ibb.co/ggZDqa

Picture of the Mapping from XML to X12
https://ibb.co/k5qWbF

In the above XML all notice Objects are grouped using 'group-adjecent' library function based on 'contractId' and each group should have one 'Detail' and I need to iterate though the individual group and create 'Sub-detail' and 'Sub-sub-detail' for each notice under group.



Topic: How to Post
Posted: Thursday, March 23, 2017 11:58:06 AM
K101 wrote:
Please visit the MapForce & MapForce Server area of this forum.

Thanks for the help.
Topic: How to Post
Posted: Wednesday, March 22, 2017 8:32:00 PM
Hi Everyone, I'm new to here and like to know where can I post questions related to Altova Mapforce.

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