Openbravo Issue Tracking System - Modules
View Issue Details
0041433ModulesSAP Connectorpublic2019-07-23 13:172019-08-02 08:36
AugustoMauch 
AugustoMauch 
normalmajorhave not tried
closedfixed 
5
 
 
caristu
0041433: It should be possible to programatically transform iDoc before they are processed by the IdocUnwrapper
The IdocUnwrapper requires a specific iDoc structure in order to work properly. After the control segment (EDI_DC40), the next segment must contain a structure that represents an Openbravo entity.

Sometimes this main segment is missing (this is managed by using a flag in the Entity Mapping window), but sometimes the changes required to properly prepare the iDoc are more complex and must be done programatically.

It should be possible to define an IdocTransformer, that would transform an Idoc before it is processed by the IdocUnwrapper. The IdocTransformer should have the EntityMappingId annotation to specify to which entity mapping it refers to.
-
No tags attached.
xml WP_PER_NEW_STRUCTURE.xml (1,269) 2019-07-23 13:30
https://issues.openbravo.com/file_download.php?file_id=13169&type=bug
diff newIdocStructure.diff (5,735) 2019-07-23 13:32
https://issues.openbravo.com/file_download.php?file_id=13170&type=bug
Issue History
2019-07-23 13:17AugustoMauchNew Issue
2019-07-23 13:17AugustoMauchAssigned To => AugustoMauch
2019-07-23 13:25hgbotCheckin
2019-07-23 13:25hgbotNote Added: 0113593
2019-07-23 13:25hgbotStatusnew => resolved
2019-07-23 13:25hgbotResolutionopen => fixed
2019-07-23 13:25hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.service.integration.sapecc/rev/2e4ce8eb10fd5c3b583d4e7167b066a8cdac033c [^]
2019-07-23 13:25hgbotCheckin
2019-07-23 13:25hgbotNote Added: 0113594
2019-07-23 13:26AugustoMauchReview Assigned To => caristu
2019-07-23 13:29AugustoMauchNote Added: 0113595
2019-07-23 13:30AugustoMauchFile Added: WP_PER_NEW_STRUCTURE.xml
2019-07-23 13:32AugustoMauchFile Added: newIdocStructure.diff
2019-07-24 18:36hgbotCheckin
2019-07-24 18:36hgbotNote Added: 0113629
2019-08-02 08:36caristuNote Added: 0113771
2019-08-02 08:36caristuStatusresolved => closed

Notes
(0113593)
hgbot   
2019-07-23 13:25   
Repository: erp/pmods/org.openbravo.service.integration.sapecc
Changeset: 2e4ce8eb10fd5c3b583d4e7167b066a8cdac033c
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Tue Jul 23 13:24:03 2019 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.service.integration.sapecc/rev/2e4ce8eb10fd5c3b583d4e7167b066a8cdac033c [^]

Fixes issue 41433: Enables programatically modifying the structure of an idoc

Now it is possible to programatically modify the structure of an idoc by implementing en IdocTransformer
annotated with the proper EntityMappingId.

This enables working with iDocs that have an structure that is not supported by the IdocUnwrapper.

---
M src/org/openbravo/service/integration/sapecc/edl/ImportDataProcessor.java
A src/org/openbravo/service/integration/sapecc/idoc/IdocTransformer.java
---
(0113594)
hgbot   
2019-07-23 13:25   
Repository: erp/pmods/org.openbravo.service.integration.sapecc
Changeset: 53e3b592d9d1b1d4e688ba5b732a821e1d05db6f
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Tue Jul 23 13:25:45 2019 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.service.integration.sapecc/rev/53e3b592d9d1b1d4e688ba5b732a821e1d05db6f [^]

Related with issue 41433: Adds automated test

---
M src-test/org/openbravo/service/integration/sapecc/SapEccTestSuite.java
A src-test/data/transformedFormattedIdoc.xml
A src-test/org/openbravo/service/integration/sapecc/edl/IdocTransformerShould.java
A src-test/org/openbravo/service/integration/sapecc/edl/TestIdocTransformer.java
---
(0113595)
AugustoMauch   
2019-07-23 13:29   
To test it, apply the attached patch (it adds a transformer for the WP_PER idoc), and import the attached idoc.

In the attached idoc, the usual main segment of the WP_PER is wrapped inside another segment. The attached transformed gets rid of this extra segment.
(0113629)
hgbot   
2019-07-24 18:36   
Repository: erp/pmods/org.openbravo.service.integration.sapecc
Changeset: bd30dba8027e421b3fd49cfafd07b8e596c20ad6
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Wed Jul 24 18:36:25 2019 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.service.integration.sapecc/rev/bd30dba8027e421b3fd49cfafd07b8e596c20ad6 [^]

Related with issue 41433: New functionality can be used in IdocImportTestHelper

---
M src-test/org/openbravo/service/integration/sapecc/edl/IdocImportTestHelper.java
---
(0113771)
caristu   
2019-08-02 08:36   
Reviewed