org.camunda.bpm.model.cmmn
Class Cmmn

java.lang.Object
  extended by org.camunda.bpm.model.cmmn.Cmmn

public class Cmmn
extends Object

Author:
Roman Smirnov

Field Summary
static Cmmn INSTANCE
          the singleton instance of Cmmn.
 
Constructor Summary
protected Cmmn()
          Register known types of the Cmmn model
 
Method Summary
static String convertToString(CmmnModelInstance modelInstance)
          Allows the conversion of a CmmnModelInstance to an String.
static CmmnModelInstance createEmptyModel()
          Allows creating an new, empty CmmnModelInstance.
protected  String doConvertToString(CmmnModelInstance modelInstance)
           
protected  CmmnModelInstance doCreateEmptyModel()
           
protected  CmmnModelInstance doReadModelFromFile(File file)
           
protected  CmmnModelInstance doReadModelFromInputStream(InputStream is)
           
protected  void doRegisterTypes(org.camunda.bpm.model.xml.ModelBuilder modelBuilder)
           
protected  void doValidateModel(CmmnModelInstance modelInstance)
           
protected  void doWriteModelToFile(File file, CmmnModelInstance modelInstance)
           
protected  void doWriteModelToOutputStream(OutputStream os, CmmnModelInstance modelInstance)
           
 org.camunda.bpm.model.xml.Model getCmmnModel()
           
 org.camunda.bpm.model.xml.ModelBuilder getCmmnModelBuilder()
           
static CmmnModelInstance readModelFromFile(File file)
          Allows reading a CmmnModelInstance from a File.
static CmmnModelInstance readModelFromStream(InputStream stream)
          Allows reading a CmmnModelInstance from an InputStream
 void setCmmnModel(org.camunda.bpm.model.xml.Model cmmnModel)
           
static void validateModel(CmmnModelInstance modelInstance)
          Validate model DOM document
static void writeModelToFile(File file, CmmnModelInstance modelInstance)
          Allows writing a CmmnModelInstance to a File.
static void writeModelToStream(OutputStream stream, CmmnModelInstance modelInstance)
          Allows writing a CmmnModelInstance to an OutputStream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INSTANCE

public static Cmmn INSTANCE
the singleton instance of Cmmn. If you want to customize the behavior of Cmmn, replace this instance with an instance of a custom subclass of Cmmn.

Constructor Detail

Cmmn

protected Cmmn()
Register known types of the Cmmn model

Method Detail

readModelFromFile

public static CmmnModelInstance readModelFromFile(File file)
Allows reading a CmmnModelInstance from a File.

Parameters:
file - the File to read the CmmnModelInstance from
Returns:
the model read
Throws:
CmmnModelException - if the model cannot be read

readModelFromStream

public static CmmnModelInstance readModelFromStream(InputStream stream)
Allows reading a CmmnModelInstance from an InputStream

Parameters:
stream - the InputStream to read the CmmnModelInstance from
Returns:
the model read
Throws:
org.camunda.bpm.model.xml.ModelParseException - if the model cannot be read

writeModelToFile

public static void writeModelToFile(File file,
                                    CmmnModelInstance modelInstance)
Allows writing a CmmnModelInstance to a File. It will be validated before writing.

Parameters:
file - the File to write the CmmnModelInstance to
modelInstance - the CmmnModelInstance to write
Throws:
CmmnModelException - if the model cannot be written
org.camunda.bpm.model.xml.ModelValidationException - if the model is not valid

writeModelToStream

public static void writeModelToStream(OutputStream stream,
                                      CmmnModelInstance modelInstance)
Allows writing a CmmnModelInstance to an OutputStream. It will be validated before writing.

Parameters:
stream - the OutputStream to write the CmmnModelInstance to
modelInstance - the CmmnModelInstance to write
Throws:
org.camunda.bpm.model.xml.ModelException - if the model cannot be written
org.camunda.bpm.model.xml.ModelValidationException - if the model is not valid

convertToString

public static String convertToString(CmmnModelInstance modelInstance)
Allows the conversion of a CmmnModelInstance to an String. It will be validated before conversion.

Parameters:
modelInstance - the model instance to convert
Returns:
the XML string representation of the model instance

validateModel

public static void validateModel(CmmnModelInstance modelInstance)
Validate model DOM document

Parameters:
modelInstance - the CmmnModelInstance to validate
Throws:
org.camunda.bpm.model.xml.ModelValidationException - if the model is not valid

createEmptyModel

public static CmmnModelInstance createEmptyModel()
Allows creating an new, empty CmmnModelInstance.

Returns:
the empty model.

doReadModelFromFile

protected CmmnModelInstance doReadModelFromFile(File file)

doReadModelFromInputStream

protected CmmnModelInstance doReadModelFromInputStream(InputStream is)

doWriteModelToFile

protected void doWriteModelToFile(File file,
                                  CmmnModelInstance modelInstance)

doWriteModelToOutputStream

protected void doWriteModelToOutputStream(OutputStream os,
                                          CmmnModelInstance modelInstance)

doConvertToString

protected String doConvertToString(CmmnModelInstance modelInstance)

doValidateModel

protected void doValidateModel(CmmnModelInstance modelInstance)

doCreateEmptyModel

protected CmmnModelInstance doCreateEmptyModel()

doRegisterTypes

protected void doRegisterTypes(org.camunda.bpm.model.xml.ModelBuilder modelBuilder)

getCmmnModel

public org.camunda.bpm.model.xml.Model getCmmnModel()
Returns:
the Model instance to use

getCmmnModelBuilder

public org.camunda.bpm.model.xml.ModelBuilder getCmmnModelBuilder()

setCmmnModel

public void setCmmnModel(org.camunda.bpm.model.xml.Model cmmnModel)
Parameters:
cmmnModel - the cmmnModel to set


Copyright © 2015 camunda services GmbH. All rights reserved.