Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0041142
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Modules] SAP Connectormajoralways2019-06-20 18:242022-02-01 08:05
ReportermartinsdanView Statuspublic 
Assigned ToTriage Platform Base 
PrioritynormalResolutionopenFixed in Version
StatusnewFix in branchFixed in SCM revision
ProjectionnoneETAnoneTarget Version
OSMac OSDatabasePostgreSQLJava version1.7
OS Version10.12Database version9.5Ant version1.9.4
Product VersionSCM revision 
Regression date
Regression introduced by commit
Regression level
Review Assigned To
Regression introduced in release
Summary

0041142: Problem creating several mappings for the same iDoc

DescriptionWe need to sync several transactions like shipments and distribution orders for example.
In this case, we have a problem because we want to map 2 Openbravo entities with the same idoc.
In this case, we should have 2 Mapping entries with the same External Entity but a different Openbravo Entity.

Everything seems ok when generating the idoc, but an error is thrown when getting the path to save the idoc.
org.openbravo.service.integration.sapecc.process.SapEccExporterSynchronizableBusinessObjectExporter.java

String fileName = getFilePath(idocType);

This will eventually call:
org.openbravo.service.integration.sapecc.process.SapEccExporterSynchronizableBusinessObjectExporter.java

  private EntityMapping getEntityMapping(String idocType) {
    OBCriteria<EntityMapping> criteria = OBDal.getInstance().createCriteria(EntityMapping.class);
    criteria.add(Restrictions.eq(EntityMapping.PROPERTY_SYSTEMTYPE, SapEccConstants.SYSTEM_TYPE));
    criteria.add(Restrictions.eq(EntityMapping.PROPERTY_MAPPEDENTITY, idocType));
    criteria.add(Restrictions.eq(EntityMapping.PROPERTY_INTEGRATIONDIRECTION,
        IntegrationDirection.EXPORT_FROM_OB.getLabel()));
    criteria.setFilterOnReadableClients(false);
    criteria.setFilterOnReadableOrganization(false);
    return (EntityMapping) criteria.uniqueResult();
  }

Here is the problem, this will throw an error because the query returns 2 results.
org.hibernate.NonUniqueResultException: query did not return a unique result: 2
Steps To ReproduceWe need to create 2 mappings to export the same idoc.
Proposed SolutionI think we should get this information somehow from the context we are executing the process because it should be possible to have several combinations for the same idoc and entity and schedule the selected implementation.

A proposed solution patch is attached.
TagsNo tags attached.
Attached Filesdiff file icon noUniqueError.diff [^] (4,327 bytes) 2019-06-20 18:24 [Show Content]

- Relationships Relation Graph ] Dependency Graph ]

-  Notes
There are no notes attached to this issue.

- Issue History
Date Modified Username Field Change
2019-06-20 18:24 martinsdan New Issue
2019-06-20 18:24 martinsdan Assigned To => platform
2019-06-20 18:24 martinsdan File Added: noUniqueError.diff
2022-02-01 08:05 alostale Assigned To platform => Triage Platform Base


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker