The ReqIF model reader enables to read:
The RIF/ReqIF data must be stored in an XML file, as described by the related RIF/ReqIF specification. The XML document may be archived in a Zip file (recommended).
External files (e.g. images or spreadsheets) might be referenced by the RIF/ReqIF document. If the XML document is stored in an archive file, those external files must be stored within the Zip archive. Otherwise the file paths are resolved relatively to the XML document location.
RIF 1.1a and 1.2 files are silently converted to ReqIF on loading.
Noteworthy and known limitations:
SpecGroup
and SpecHierarchyRoot
elements are merged into a ReqIF Specification
.
Both source elements are expected to reference the exact same set of SpecObject
s.
SpecGroupHierarchyRoot
and SpecGroupHierarchy
are not supported.
These elements are lost during import.
SpecType
subtypes for each kind of element.
If a RIF SpecType
is used by different kinds of element (e.g. a SpecObject
and a Specification
),
this SpecType
becomes several types, with attributes being dispatched or copied as needed.
If the model is then saved back to a RIF file, the created SpecType
s are merged into one SpecType
, like in the original file.
SpecRelation.source
and SpecRelation.target
,
reqif.reference.global=true
) are loaded as EMF proxy elements.
A warning is displayed in the Console view for such references, as they are not resolved to the actual corresponding element.OLE objects can be inserted in a AttributeValueXHTML
instance.
In that case the AttributeValueXHTML.theValue
attribute contains XHTML tags that reference the OLE objects, e.g.:
<xhtml:div><xhtml:object data="path_to_ole_object"/></xhtml:div>
Here is a sample code that determines attached OLE objects and get access to their content:
import com.sodius.mdw.metamodel.reqif.*; import com.sodius.mdw.metamodel.reqif.xhtml.Attachment; import com.sodius.mdw.metamodel.reqif.xhtml.AttachmentResolver; import com.sodius.mdw.metamodel.reqif.xhtml.XHTMLUtils; ... File reqifFile = new File(<location of the loaded ReqIF file>); AttributeValueXHTML value = ...; AttachmentResolver resolver = XHTMLUtils.createAttachmentResolver(reqifFile); for (Attachment attachment : XHTMLUtils.getAttachments(value)) { System.out.println("Found an OLE object: " + attachment.getPath()); InputStream input = resolver.getInputStream(attachment); ... }
When the reader is launched from rules or Java code, you can set options to tweak the reader's behavior. Refer to the Javadoc of Options to list available settings.