Upload XML File to XFRACAS

ReliaSoft's XFRACAS is a web-based, closed-loop, incident/failure/data reporting, analysis and corrective action system. You can import data into XFRACAS either via XML files or directly from ReliaSoft's Xfmea, RCM++ or RBI software. In addition, you can use the Synthesis API to create custom solutions for importing XML data. In this tutorial, you'll learn the basics for uploading an XML file to XFRACAS and processing it for import.

Prerequisites
Before you begin:


 * You must at least have read access to a Synthesis enterprise test repository that contains XFRACAS data.


 * In XFRACAS, you must at least have the "Manage Import" admin permissions to an XFRACAS entity.


 * You will need to provide a sample XML file to work with the tutorial. The XML file must be in the correct XFRACAS XML format. The XFRACAS 11 Import Business Logic (PDF) document provides a complete description of the format.

Tutorial: Upload XML file to XFRACAS
The following example demonstrates a basic solution for uploading an XML file to an XFRACAS entity. A discussion of the example follows.

The VBA version of the code sample is available here.

VB.NET SynthesisAPI Module1 Main MyRepository Repository MyRepository.ConnectToSQLRepository ListOfEntities NameIdPair ListOfEntities = MyRepository.XFRACAS.GetAllXfracasEntities EntityID Integer EntityID = ListOfEntities(0).ID    j  Integer j = MyRepository.XFRACAS.ImportXfracasXmlFile(EntityID, SynthesisAPI.XFRACASImportType.Incident,, )

Discussion
Begin by connecting to a Synthesis enterprise repository that contains XFRACAS data. Here, we use the ConnectToSQLRepository method to connect to an SQL repository. (For Oracle, use the ConnectToOracleRepository method.)

MyRepository Repository MyRepository.ConnectToSQLRepository

The next step is to specify the XFRACAS entity that will be receiving the XML file. First, we get an array of all available XFRACAS entities in the repository via the XFRACAS.GetAllXFRACASEntities method. ListOfEntities NameIdPair ListOfEntities = MyRepository.XFRACAS.GetAllXfracasEntities

Then we get the ID# of the target XFRACAS entity:

EntityID Integer EntityID = ListOfEntities(0).ID

We use the XFRACAS.ImportXFRACASXMLFile method to upload the XML file to XFRACAS. The method requires that you specify the entity ID and the type of XFRACAS element (e.g., incident, problem, issue, etc.) described in the XML file. In this example, we're uploading an XML file that contains XFRACAS incidents.

Note that the method only sends the XML file to the import queue of the XFRACAS entity; it doesn't process the file for import. The import will need to be triggered, either via the XFRACAS web interface or by the API (see the Notes section below for details).

j Integer j = MyRepository.XFRACAS.ImportXfracasXmlFile(EntityID, XFRACASImportType.Incident,, )