Description
As a COMPAS user service, this US purpose is to create a service to add a new Private object in current SCD file.
As service user, I would like to have a service in order to create a new Private object in current SCD file by defining where to create the Private, its type, its source and its value or its namespace:node with the XSD file to check the Private syntax.
Prerequisites:
- None
The inputs of this service are:
- A previous existing SCD file (Mandatory) defined by Header.id, Header.version and Header.revision.
- XPath where to create the Private in current SCD file (Required)
- Private type (Required) (String)
- Private source (Optional), it is the URL of the source
- Private value or XML fragment (Optional) (String). It may contain:
- the value of the Private
- OR an XML fragment such as a set of: <namespace:node xmlns:namespace=URL attributes/>
- XSD file of the Private to validate the Private section syntax (Required). This input refers to a folder path containing the XSD
US process
SCD file create Private section UseCase:
The following steps have to be considered to add Private section into current SCD file :
Step 1:
Check the presence of required inputs and the validity of inputs:
- Check that XPath where to create the Private section is provided as input else an error message is returned: "XPath where to create the Private section is missing"
- Check that XPath where to create the Private section exists in current SCD file else an error message is returned: "XPath where to create the Private section doesn't exist in current SCD file"
- Check that Private type is provided as input else an error message is returned: "Private type is missing"
- Check that XSD file to validate the Private section syntax is provided as input else an error message is returned: "The XSD file to validate the Private section syntax is missing"
- If Private source is provided as input, check that URL is valid else an error message is returned: "The Private source is invalid"
- Check that Private section syntax is valid by using the XSD file else an error message is returned: "Private section syntax is invalid"
- Check that the new Private XML section doesn't already exist in current SCD file else an error message is returned: "This Private XML section already exists in current SCD file". Two Private XML sections are identical when they have:
- same XPath
- same type
- same hash code for the XML section
Note : the norm doesn't define the uniqueness of a Private but we have chosen to define the uniqueness of the Private thanks to following attributes.
- XPath
- and Type
- and hash code of the XML section
Step 2:
- If no error has occurred during the inputs checking, then create the Private section at the specified place into the SCD file
Output:
The Private section is created at the specified place into the SCD file and its syntax is validated by XSD file of the Private.
Error messages:
See error messages provided all along step 1
Private section syntax example:
<Private type="RTE-BAP"> <rte:BAP xmlns:rte="http://www.rte-france.com" variant="N/A" defaultValue="N/A" dataStreamKey="DYN_LDEPF_DIGITAL CHANNEL_46_BOOLEAN"/> </Private>
<Private type="RTE-BAP" source="http://www.rte-france.com">45</Private>
Acceptance criteria:
- Check that if at least one required input is missing then an error message is returned. Required inputs are:
- XPath where to create the Private
- Private type
- XSD file of the Private to validate the Private section syntax
- Check that if XPath where to create the Private section doesn't exist in current SCD file then an error message is returned
- Check that if Private source is provided as input and that Private source URL is not valid then an error message is returned
- Check that if Private section syntax is not validated by the XSD file then an error message is returned
- Check that if Private XML section already exists in current SCD file then an error message is returned
- Check that if all previous steps are done without any error, then the Private section is created into current SCD file