public class ProcessModelXMLImport
extends java.lang.Object
implements org.xml.sax.ErrorHandler
ProcessModelFactory| Modifier and Type | Field and Description |
|---|---|
protected java.util.logging.Logger |
logger
The logger for XML imports.
|
| Constructor and Description |
|---|
ProcessModelXMLImport(ProcessModelFactory factory)
Constructor, requiring the factory to use.
|
| Modifier and Type | Method and Description |
|---|---|
void |
error(org.xml.sax.SAXParseException spe) |
void |
fatalError(org.xml.sax.SAXParseException spe) |
static java.util.Map<java.util.UUID,java.util.UUID> |
getAdhocTemplateMappingFromFile(java.io.File file)
Fetches the adhoc template ID mappings stored in the specified file.
|
static java.util.Map<java.util.UUID,java.util.UUID> |
getBaseTemplateMappingFromFile(java.io.File file)
Fetches the base template ID mappings stored in the specified file.
|
ExecutableBusinessProcess |
getEBPForDocument(org.w3c.dom.Document document)
Retrieves the corresponding ExecutableBusinessProcess
|
static java.util.Map<java.util.UUID,java.util.UUID> |
getEmbeddedTemplateMappingFromFile(java.io.File file)
Fetches the embedded template ID mappings stored in the specified file.
|
ExecutableInstance |
getExecutableInstanceFromDocument(ExecutionFactory executionFactory,
org.w3c.dom.Document document,
Template template)
Creates an instance using the given DOM document.
|
ExecutableInstance |
getExecutableInstanceFromFile(ExecutionFactory executionFactory,
java.io.File file)
Reads a process instance from the given file and determines the file type.
|
ExecutableInstance |
getExecutableInstanceFromFile(ExecutionFactory executionFactory,
java.io.File file,
Template template)
Reads a process instance from the given file and determines the file type.
|
ExecutableInstance |
getExecutableInstanceFromStream(ExecutionFactory executionFactory,
java.io.InputStream stream,
Template template)
Reads a process instance from the designated input stream.
|
Instance |
getInstanceFromDocument(org.w3c.dom.Document document,
Template template)
Creates an instance using the given DOM document.
|
Instance |
getInstanceFromFile(java.io.File file)
Reads a process instance from the given file and determines the file type.
|
Instance |
getInstanceFromFile(java.io.File file,
Template template)
Reads a process instance from the given file and determines the file type.
|
Instance |
getInstanceFromStream(java.io.InputStream inputStream)
Reads a process instance from an input stream.
|
static java.util.Map<java.util.UUID,ProcessModelXMLHelperTools.LockDescription> |
getInstanceLocksFromFile(java.io.File file)
Fetches the current locks stored in the specified file.
|
InstanceStatus |
getInstanceStatusFromInstanceDocument(org.w3c.dom.Document document)
Reads a process instance status from the given.
|
InstanceStatus |
getInstanceStatusFromInstanceFile(java.io.File file)
Reads a process instance status from the given.
|
boolean |
getIsModifiedFromInstanceDocument(org.w3c.dom.Document document)
Returns the state of the isModified attribute in the given document
of an instance.
|
ProcessModelParameter |
getParameterForDocument(org.w3c.dom.Document document)
Retrieves the Corresponding parameter
|
java.util.Set<ProcessModelParameter> |
getParameterSetForDocument(org.w3c.dom.Document document)
Retrieves the corresponding set of Parameter
|
static java.util.Set<ProcessModelXMLHelperTools.SerialisableProcessType> |
getProcessTypesFromFile(java.io.File file)
Fetches the process types stored in the specified file.
|
Template |
getTemplateFromDocument(org.w3c.dom.Document document)
Creates a template using the given DOM document.
|
Template |
getTemplateFromFile(java.io.File file)
Reads a process template from the given file and determines the file type.
|
Template |
getTemplateFromStream(java.io.InputStream inputStream)
Reads a process template from an input stream.
|
java.util.UUID |
getTemplateIDFromInstanceDocument(org.w3c.dom.Document document)
Returns the template ID stored in the given document
|
java.util.UUID |
getTemplateIDFromInstanceFile(java.io.File file)
Reads a process instance from the given file and determines the file type.
|
static java.util.Map<java.util.UUID,ProcessModelXMLHelperTools.TemplateInformation> |
getTemplateInformationsFromFile(java.io.File file)
Fetches the template informations stored in the specified file.
|
static java.util.Map<java.util.UUID,ProcessModelXMLHelperTools.LockDescription> |
getTemplateLocksFromFile(java.io.File file)
Fetches the current locks stored in the specified file.
|
TemplateStatus |
getTemplateStatusFromDocument(org.w3c.dom.Document document)
Returns a template status object from the given template document.
|
TemplateStatus |
getTemplateStatusFromStream(java.io.InputStream inputStream)
Reads the template status from the given template file.
|
TemplateStatus |
getTemplateStatusFromTemplateFile(java.io.File file)
Reads the template status from the given template file.
|
boolean |
instanceStatusDatePresent(org.w3c.dom.Document doc)
Gets whether the designated document contains an instance status with a
migration (and execution) status date.
|
static void |
validateInstanceFormatVersion(org.w3c.dom.Document instance)
Validates the format version of the given instance document.
|
static void |
validateTemplateFormatVersion(org.w3c.dom.Document template)
Validates the format version of the given template document.
|
void |
warning(org.xml.sax.SAXParseException spe) |
protected final java.util.logging.Logger logger
public ProcessModelXMLImport(ProcessModelFactory factory)
factory - the factory, that shall be used by the importer to create
the objects of the processModelpublic Template getTemplateFromFile(java.io.File file) throws VersionException, XMLFormatException, java.io.IOException
file - The file which will be parsedVersionException - if the format version of the template file is not
or no longer supportedXMLFormatException - if the document is not well-formed the input
file does not contain a valid templatejava.io.FileNotFoundException - if the file does not exist or can't be openedjava.io.IOException - if error occurs while reading from the filepublic TemplateStatus getTemplateStatusFromTemplateFile(java.io.File file) throws VersionException, XMLFormatException, java.io.IOException
file - The file which will be parsedVersionException - if the format version of the template file is not
or no longer supportedXMLFormatException - if the document is not well-formed the input
file does not contain a valid templatejava.io.FileNotFoundException - if the file does not exist or can't be openedjava.io.IOException - if error occurs while reading from the filepublic Instance getInstanceFromFile(java.io.File file) throws VersionException, XMLFormatException, java.io.IOException
file - The file which will be parsedVersionException - if the format version of the instance file is
not or no longer supportedXMLFormatException - if the document is not well-formed the input
file does not contain a valid instancejava.io.FileNotFoundException - if the file does not exist or can't be openedjava.io.IOException - if error occurs while reading from the filepublic ExecutableInstance getExecutableInstanceFromFile(ExecutionFactory executionFactory, java.io.File file) throws VersionException, XMLFormatException, java.io.IOException
executionFactory - The execution factory needed for the creation of
the executable instance.file - The file which will be parsedVersionException - if the format version of the instance file is
not or no longer supportedXMLFormatException - if the document is not well-formed the input
file does not contain a valid instancejava.io.FileNotFoundException - if the file does not exist or can't be openedjava.io.IOException - if error occurs while reading from the filepublic Instance getInstanceFromFile(java.io.File file, Template template) throws VersionException, XMLFormatException, java.io.IOException
file - The file which will be parsedtemplate - The template object to use in the instance object.VersionException - if the format version of the instance file is
not or no longer supportedXMLFormatException - if the document is not well-formed the input
file does not contain a valid instancejava.io.FileNotFoundException - if the file does not exist or can't be openedjava.io.IOException - if error occurs while reading from the filepublic ExecutableInstance getExecutableInstanceFromStream(ExecutionFactory executionFactory, java.io.InputStream stream, Template template) throws VersionException, XMLFormatException, java.io.IOException
executionFactory - The execution factory needed for the creation of
the executable instance.stream - The stream from which to read the XML.template - The template object to use in the instance object.VersionException - if the format version of the instance is not or no
longer supported.XMLFormatException - if the document is not well-formed the input
stream does not contain a valid instance.java.io.IOException - if error occurs while reading from the stream.public ExecutableInstance getExecutableInstanceFromFile(ExecutionFactory executionFactory, java.io.File file, Template template) throws VersionException, XMLFormatException, java.io.IOException
executionFactory - The execution factory needed for the creation of
the executable instance.file - The file which will be parsed.template - The template object to use in the instance object.VersionException - if the format version of the instance file is
not or no longer supportedXMLFormatException - if the document is not well-formed the input
file does not contain a valid instancejava.io.FileNotFoundException - if the file does not exist or can't be openedjava.io.IOException - if error occurs while reading from the filepublic java.util.UUID getTemplateIDFromInstanceFile(java.io.File file)
throws VersionException,
XMLFormatException,
java.io.IOException
file - The file which will be parsedVersionException - if the format version of the instance file is
not or no longer supportedXMLFormatException - if the document is not well-formed the input
file does not contain a valid instancejava.io.FileNotFoundException - if the file does not exist or can't be openedjava.io.IOException - if error occurs while reading from the filepublic InstanceStatus getInstanceStatusFromInstanceFile(java.io.File file) throws VersionException, XMLFormatException, java.io.IOException
file - The file which will be parsedVersionException - if the format version of the instance file is not
or no longer supportedXMLFormatException - if the document is not well-formed the input
file does not contain a valid instancejava.io.FileNotFoundException - if the file does not exist or can't be openedjava.io.IOException - if error occurs while reading from the filepublic InstanceStatus getInstanceStatusFromInstanceDocument(org.w3c.dom.Document document) throws VersionException, XMLFormatException
document - The (instance) document containing the instanceStatusVersionException - if the format version of the instance file is not
or no longer supportedXMLFormatException - if the document is not well-formed the input
file does not contain a valid instancepublic boolean instanceStatusDatePresent(org.w3c.dom.Document doc)
doc - The document which to check for whether it contains an instance
status with migration (and execution) status date.public Template getTemplateFromStream(java.io.InputStream inputStream) throws VersionException, XMLFormatException, java.io.IOException
inputStream - VersionException - if the format version of the template stream is
not or no longer supportedXMLFormatException - if the document is not well-formed the input
stream does not contain a valid templatejava.io.IOException - if error occurs while reading from the streampublic TemplateStatus getTemplateStatusFromStream(java.io.InputStream inputStream) throws VersionException, XMLFormatException, java.io.IOException
inputStream - The input stream that will be parsedVersionException - if the format version of the template file is not
or no longer supportedXMLFormatException - if the document is not well-formed the input
file does not contain a valid templatejava.io.FileNotFoundException - if the file does not exist or can't be openedjava.io.IOException - if error occurs while reading from the filejava.lang.IllegalArgumentException - If the XML in the stream does not contain
a template status.public TemplateStatus getTemplateStatusFromDocument(org.w3c.dom.Document document)
document - An XML document.public Instance getInstanceFromStream(java.io.InputStream inputStream) throws VersionException, XMLFormatException, java.io.IOException
inputStream - VersionException - if the format version of the instance stream is
not or no longer supportedXMLFormatException - if the document is not well-formed the input
stream does not contain a valid instancejava.io.IOException - if error occurs while reading from the streampublic Template getTemplateFromDocument(org.w3c.dom.Document document) throws java.io.IOException
document - java.io.IOException - If there are problems decoding an EBP component signature from Base64, an
IOException will be thrown.public Instance getInstanceFromDocument(org.w3c.dom.Document document, Template template) throws java.io.IOException
document - template - The template to be used as structure, or null if the
structure is stored inline.java.io.IOException - If there are problems decoding an EBP component signature from Base64, an
IOException will be thrown.public ExecutableInstance getExecutableInstanceFromDocument(ExecutionFactory executionFactory, org.w3c.dom.Document document, Template template) throws java.io.IOException
document - template - The template to be used as structure, or null if the
structure is stored inline.executionFactory - The execution factory needed for the creation of
the executable instance.java.io.IOException - If there are problems decoding an EBP component signature from Base64, an
IOException will be thrown.public java.util.UUID getTemplateIDFromInstanceDocument(org.w3c.dom.Document document)
document - public boolean getIsModifiedFromInstanceDocument(org.w3c.dom.Document document)
document - public static void validateTemplateFormatVersion(org.w3c.dom.Document template)
throws VersionException
VersionException if the format version is not or no longer
supported.template - the template document to be testedVersionException - if the format version is not supportedpublic static void validateInstanceFormatVersion(org.w3c.dom.Document instance)
throws VersionException
VersionException if the format version is not or no longer
supported.instance - the instance document to be testedVersionException - if the format version is not supportedpublic ExecutableBusinessProcess getEBPForDocument(org.w3c.dom.Document document) throws java.io.IOException
document - The document, for which the EBP is neededjava.io.IOException - If there are problems decoding the component signature from Base64, an
IOException will be thrown.public ProcessModelParameter getParameterForDocument(org.w3c.dom.Document document)
document - The document, for which the parameter are neededpublic java.util.Set<ProcessModelParameter> getParameterSetForDocument(org.w3c.dom.Document document)
document - public static java.util.Map<java.util.UUID,ProcessModelXMLHelperTools.LockDescription> getTemplateLocksFromFile(java.io.File file) throws java.io.FileNotFoundException, XMLFormatException, java.io.IOException, VersionException
file - File to loadjava.io.IOExceptionXMLFormatExceptionjava.io.FileNotFoundExceptionVersionException - is thrown if the version of the file is not correctpublic static java.util.Map<java.util.UUID,ProcessModelXMLHelperTools.LockDescription> getInstanceLocksFromFile(java.io.File file) throws java.io.FileNotFoundException, XMLFormatException, java.io.IOException, VersionException
file - File to loadjava.io.IOExceptionXMLFormatExceptionjava.io.FileNotFoundExceptionVersionException - is thrown if the version of the file is not correctpublic static java.util.Map<java.util.UUID,java.util.UUID> getEmbeddedTemplateMappingFromFile(java.io.File file)
throws java.io.FileNotFoundException,
XMLFormatException,
java.io.IOException,
VersionException
file - File to loadjava.io.IOExceptionXMLFormatExceptionjava.io.FileNotFoundExceptionVersionException - is thrown if the version of the file is not correctpublic static java.util.Map<java.util.UUID,java.util.UUID> getBaseTemplateMappingFromFile(java.io.File file)
throws java.io.FileNotFoundException,
XMLFormatException,
java.io.IOException,
VersionException
file - File to loadjava.io.IOExceptionXMLFormatExceptionjava.io.FileNotFoundExceptionVersionException - is thrown if the version of the file is not correctpublic static java.util.Set<ProcessModelXMLHelperTools.SerialisableProcessType> getProcessTypesFromFile(java.io.File file) throws java.io.FileNotFoundException, XMLFormatException, java.io.IOException, VersionException
file - File to loadjava.io.IOExceptionXMLFormatExceptionjava.io.FileNotFoundExceptionVersionException - is thrown if the version of the file is not correctpublic static java.util.Map<java.util.UUID,java.util.UUID> getAdhocTemplateMappingFromFile(java.io.File file)
throws java.io.FileNotFoundException,
XMLFormatException,
java.io.IOException,
VersionException
file - File to loadjava.io.IOExceptionXMLFormatExceptionjava.io.FileNotFoundExceptionVersionException - is thrown if the version of the file is not
correctpublic static java.util.Map<java.util.UUID,ProcessModelXMLHelperTools.TemplateInformation> getTemplateInformationsFromFile(java.io.File file) throws java.io.FileNotFoundException, XMLFormatException, java.io.IOException, VersionException
file - File to loadjava.io.IOExceptionXMLFormatExceptionjava.io.FileNotFoundExceptionVersionException - is thrown if the version of the file is not correctpublic void error(org.xml.sax.SAXParseException spe)
throws org.xml.sax.SAXException
error in interface org.xml.sax.ErrorHandlerorg.xml.sax.SAXExceptionpublic void fatalError(org.xml.sax.SAXParseException spe)
throws org.xml.sax.SAXException
fatalError in interface org.xml.sax.ErrorHandlerorg.xml.sax.SAXExceptionpublic void warning(org.xml.sax.SAXParseException spe)
throws org.xml.sax.SAXException
warning in interface org.xml.sax.ErrorHandlerorg.xml.sax.SAXException