OAGi / Score

Score
MIT License
9 stars 6 forks source link

Export/Import the BIE #524

Open kbserm opened 6 years ago

kbserm commented 6 years ago

To be able to retain BIE data between releases. Assume that there is no change to CC data except the BIE extension that uses only existing OAGIS components. User Data, Business Context Data, Code list. Look at the XML Schema Profile BOD spec for the BIE data.

hakjuoh commented 6 years ago

@kbserm

One disadvantage when we used the XML Schema Profile BOD spec for the BIE data is that the history data of BIEs should be lost. Furthermore, exported BIE extension data might conflict if the importee database has same BIE extension data. Thus, we should notify when the user attempts to import as "Some data (Users, Code Lists, Extensions, etc.) might be overwritten."

See the sample exported xml data:

<?xml version="1.0"?>
<srt>
    <users>
        <user id="oagis" oagis_developer="true">
            <password>$2a$10$pp.KvtaKOMjsKtH407o9o.csMj.JXsysm.VBuxC6bYQzq20OFerdS</password>
            <name>Open Applications Group Developer</name>
            <organization>Open Applications Group</organization>
        </user>
        <user id="hakju" oagis_developer="false">
            <password>$2a$10$JyLPwDhHqo0P6Do.CSTJVeidDmTNuM1nDQbd8Qc76LJ41zgaSDneG</password>
            <name>hakju</name>
        </user>
    </users>

    <context_categories>
        <context_category id="oagis-id-bc3765e26df04a27a7e184f10d579d19">
            <name>Sample Context Category</name>
            <description>Sample Context Category Description</description>
        </context_category>
    </context_categories>

    <context_schemes>
        <context_scheme id="oagis-id-b5edca11b1624dbc8e9af2016514bba4"
                        context_category_ref="oagis-id-bc3765e26df04a27a7e184f10d579d19">
            <scheme_id>Sample Context Scheme ID</scheme_id>
            <scheme_name>Sample Context Scheme Name</scheme_name>
            <description>Sample Context Scheme Description</description>
            <scheme_agency_id>Sample Context Scheme Agency ID</scheme_agency_id>
            <scheme_version_id>Sample Context Scheme Version ID</scheme_version_id>
            <created by="oagis" timestamp="2018-05-29T13:26:32.174000-05:00"/>
            <updated by="oagis" timestamp="2018-05-29T13:26:32.174000-05:00"/>

            <scheme_values>
                <scheme_value id="oagis-id-1cb05fb3e3cd4258911eb4754df5a36d">
                    <value>Sample Context Scheme Value</value>
                    <meaning>Sample Context Scheme Meaning</meaning>
                </scheme_value>
            </scheme_values>
        </context_scheme>
    </context_schemes>

    <business_contexts>
        <business_context id="oagis-id-99b9471ca2274e56892a5381dbbddf9a">
            <name>Sample Business Context</name>
            <created by="oagis" timestamp="2018-05-29T13:26:50.034000-05:00"/>
            <updated by="oagis" timestamp="2018-05-29T13:26:50.034000-05:00"/>

            <context_values>
                <context_value context_scheme_value_ref="oagis-id-1cb05fb3e3cd4258911eb4754df5a36d"/>
            </context_values>
        </business_context>
    </business_contexts>

    <business_information_entities>
        <business_information_entity owner="hakju" release="10.4" state="Editing"
                                     business_context_ref="oagis-id-99b9471ca2274e56892a5381dbbddf9a"
                                     href="file:///oagis-id-aee9d8f1b9b548778492c088121a5412_standalone.xsd"/>
    </business_information_entities>
</srt>
hakjuoh commented 6 years ago

@kbserm I noticed that there is a problem when importing data from generated BIE expressions (i.e. XML schemas). Here's an example of the generated BIE of the 'ProcessBOM'.

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.openapplications.org/oagis/10" targetNamespace="http://www.openapplications.org/oagis/10" elementFormDefault="qualified" attributeFormDefault="unqualified">
  <xsd:element name="ProcessBOM" id="oagis-id-2b69c844974a4ae4a5ec7934fce0f8d0">
    <xsd:complexType id="oagis-id-2b3c1bfb1c564f5dbdc2fc23a8d623a2">
      <xsd:sequence>
        <xsd:element id="oagis-id-fe54bfae91ad4347a20b92960262136d" minOccurs="1" maxOccurs="unbounded" name="DataArea">
          <xsd:complexType id="oagis-id-6c30687a16424db2af5d5efa681699de">
            <xsd:sequence>
              <xsd:element id="oagis-id-f6668b9d82ef4d869f67b93163b76ada" minOccurs="1" maxOccurs="1" name="Process">
                <xsd:annotation>
                  <xsd:documentation source="http://www.openapplications.org/oagis/10">adfadfadf</xsd:documentation>
                </xsd:annotation>
                <xsd:complexType id="oagis-id-fb070fd88517420294f68b18c67da8a4">
                  <xsd:sequence />
                </xsd:complexType>
              </xsd:element>
            </xsd:sequence>
          </xsd:complexType>
        </xsd:element>
      </xsd:sequence>
    </xsd:complexType>
  </xsd:element>
</xsd:schema>

Each BIE used different guids with the corresponding CC. This means that in order to find the based CC of each BIE, the only property the import logic can use is the name attribute. However, the name attribute is not the unique property in CCs. For instance, there are 1112 ASCCPs with the 'Data Area' property term, and 538 ASCCPs with the 'Extension' property term.

The bottom line is that I think I would be better that not using BIE expressions.

hakjuoh commented 6 years ago

@kbserm The another issue is that BIEs intentionally couldn't capture 'Group' core components. The following is an example. In spite of the Note BBIE belongs to under the Free Form Text Group group ACC, it didn't reflect on a generated BIE expression. This would be happened as same in UDCCs.

<xsd:complexType id="oagis-id-18e38bad92f94807b05647bfed5ec94d">
    <xsd:annotation>
        <xsd:documentation>
            <ccts_BIEEntityTypeCode>ABIE</ccts_BIEEntityTypeCode>
            <ccts_DictionaryEntryName>BOM Option. Details</ccts_DictionaryEntryName>
            <ccts_ObjectClassTermName>BOM Option</ccts_ObjectClassTermName>
            <ccts_BasedACC_GUID>oagis-id-18d0835669784d2187bee74d6c98e60e</ccts_BasedACC_GUID>
            <ccts_BasedACCRevisionNumber>1</ccts_BasedACCRevisionNumber>
        </xsd:documentation>
    </xsd:annotation>
    <xsd:sequence>
        <xsd:element name="Note" id="oagis-id-b38c7ff8384249afb769da6599b33289" minOccurs="0" maxOccurs="unbounded">
            <xsd:annotation>
                <xsd:documentation>
                    <ccts_BIEEntityTypeCode>BBIE</ccts_BIEEntityTypeCode>
                    <ccts_DictionaryEntryName>Free Form Text Group. Note. Text</ccts_DictionaryEntryName>
                    <ccts_BasedBCC_GUID>oagis-id-41ef1010201645918eefa5093cb20583</ccts_BasedBCC_GUID>
                    <ccts_BasedBCCRevisionNumber>1</ccts_BasedBCCRevisionNumber>
                </xsd:documentation>
            </xsd:annotation>