CARL Source offers a certain number of XML interfaces as standard.
Here are some examples of import files accepted by these interfaces.
These examples illustrate the contents of the files as a function of the desired behavior:
See also the settings of the module.
Importing events with the EVENT_IN interface and an XML file
<?xml version="1.0" encoding="UTF-8"?> <entities exchangeInterface="EVENT_IN" timezone="Europe/Paris" language="fr_FR"> <event> <event_eventDate>2008-12-07 16:32:14</event_eventDate> <event_material code="MACHINE1" /> <event_comment>Machine 1 is shut down</event_comment> <event_symptom code="ARRET" /> </event> <event> <event_eventDate>2008-12-21 02:24:14</event_eventDate> <event_box code="BAT1" /> <event_comment>Water leak found in building 1</event_comment> <event_symptom code="FUITE" /> </event> </entities>
Header
References
In this example the following elements are referenced in CARL Source:
Importing a WR with the MR_IN interface and an XML file
Creation only
<?xml version="1.0" encoding="UTF-8"?> <entities exchangeInterface="MR_IN" language="fr_FR"> <MR> <mr_code>DI1</mr_code> <mr_description>Work request for car 666CSI69</mr_description> <mr_longDesc> <description_description>Random problem upon startup</description_description> </mr_longDesc> <mr_workPriority>HIGH</mr_workPriority> <mr_boxMain code="PARK-01" /> <mr_material code="666CSI69" /> <mr_site code="SITE1" /> <mr_status> <status_code>REQUEST</status_code> <status_changedBy code="DUPONT"/> <status_changedDate>2009-01-02 15:49:57</status_changedDate> </mr_status> <mr_addressee code="MARTIN" /> <mr_symptom code="ARRET" /> <mr_createdBy code="DUPONT" /> <mr_expEnd>2009-01-08 10:00:00</mr_expEnd> </MR> </entities>
In this example, the work request WR1 will be created. If WR1 already exists, the save will be rejected.
Creation or update
In order to be able to update WR1, the code or identifier of the WR must be indicated in the <WR> tag.
In the following example, WR1 is updated if it already exists, otherwise it is created.
<?xml version="1.0" encoding="UTF-8"?> <entities exchangeInterface="MR_IN" > <MR code="DI1"> <mr_code>DI1</mr_code> <mr_description>Work request for car 666CSI69</mr_description> <mr_longDesc> <description_description>Impossible to start car</description_description> </mr_longDesc> <mr_workPriority>URGENT</mr_workPriority> <mr_boxMain code="PARK-01" /> <mr_material code="666CSI69" /> <mr_site code="SITE1" /> <mr_status> <status_code>REQUEST</status_code> <status_changedBy code="DUPONT"/> <status_changedDate>2009-01-02 15:49:57</status_changedDate> </mr_status> <mr_addressee code="MARTIN" /> <mr_symptom code="ARRET" /> <mr_createdBy code="DUPONT" /> <mr_expEnd>2009-01-07 10:00:00</mr_expEnd> </MR> </entities>
Update only
In the following example,WR1 will be updated if it already exists, otherwise the save will be rejected.
<?xml version="1.0" encoding="UTF-8"?> <entities exchangeInterface="MR_IN" > <MR code="DI1"> <mr_description>Work request for car 666CSI69</mr_description> <mr_longDesc> <description_description>Impossible to start car</description_description> </mr_longDesc> <mr_workPriority>URGENT</mr_workPriority> <mr_boxMain code="PARK-01" /> <mr_material code="666CSI69" /> <mr_site code="SITE1" /> <mr_status> <status_code>REQUEST</status_code> <status_changedBy code="DUPONT"/> <status_changedDate>2009-01-02 15:49:57</status_changedDate> </mr_status> <mr_addressee code="MARTIN" /> <mr_symptom code="ARRET" /> <mr_createdBy code="DUPONT" /> <mr_expEnd>2009-01-07 10:00:00</mr_expEnd> </MR> </entities>
Supplier import: updating and deleting
Update of the list of supplier qualifications
In this case, the VENDOR integration point of the VENDOR_IN interface has the Collection attribute set to "Update."
Import of the following file will bring about the following changes on the list of Qualifications of supplier ABE:
<?xml version="1.0" encoding="UTF-8"?> <entities exchangeInterface="VENDOR_IN" externalSystem="EXT_SYST"> <vendor code="ABE"> <vendor_families> <vendorFamily family_coderef="ELECTRIQUE"> <vendorfamily_family code="ELECTRIQUE"/> <vendorfamily_description>New family: electrical</vendorfamily_description> </vendorFamily> <vendorFamily family_coderef="MECHANICAL"> <vendorfamily_family code="MECHANICAL"/> <vendorfamily_description>Existing family updated</vendorfamily_description> </vendorFamily> </vendor_families> </vendor> </entities>
The qualification (family-supplier link) is identified by:
Replacement of the list of supplier qualifications
If, however, the VENDOR integration point of the VENDOR_IN_BIS interface has the Collection attribute set to "Replacement," an import of the same file will bring about the following changes:
Explicit deletion of a supplier and a supplier qualification
Importing of the following file will, in all cases, bring about:
<?xml version="1.0" encoding="UTF-8"?> <entities exchangeInterface="VENDOR_IN" externalSystem="EXT_SYST"> <vendor code="ABE"> <vendor_families> <vendorFamily family_coderef="ELECTRIQUE"> <vendorfamily_family code="ELECTRIQUE"/> <vendorfamily_description>New family: electrical</vendorfamily_description> </vendorFamily> <vendorFamily family_coderef="MECHANICAL" delete="true"> </vendorFamily> </vendor_families> </vendor> <vendor code="A_SUPPR" delete="true"> </vendor> </entities>