Class DefaultDmnTransform
- java.lang.Object
-
- org.camunda.bpm.dmn.engine.impl.transform.DefaultDmnTransform
-
- All Implemented Interfaces:
DmnElementTransformContext
,DmnTransform
public class DefaultDmnTransform extends java.lang.Object implements DmnTransform, DmnElementTransformContext
-
-
Field Summary
Fields Modifier and Type Field Description protected DmnDataTypeTransformerRegistry
dataTypeTransformerRegistry
protected DmnDecisionImpl
decision
protected DmnDecisionTableImpl
decisionTable
protected DmnElementTransformHandlerRegistry
handlerRegistry
protected DmnHitPolicyHandlerRegistry
hitPolicyHandlerRegistry
protected DmnModelInstance
modelInstance
protected java.lang.Object
parent
protected DmnTransformer
transformer
protected java.util.List<DmnTransformListener>
transformListeners
-
Constructor Summary
Constructors Constructor Description DefaultDmnTransform(DmnTransformer transformer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
buildDecisionRequirements(java.util.Collection<Decision> decisions, java.util.Map<java.lang.String,DmnDecisionImpl> dmnDecisions)
protected void
ensureNoLoopInDecision(DmnDecision decision, java.util.List<java.lang.String> parentDecisionList, java.util.List<java.lang.String> visitedDecisions)
protected void
ensureNoLoopInDecisions(java.util.List<DmnDecision> dmnDecisionList)
DmnDataTypeTransformerRegistry
getDataTypeTransformerRegistry()
DmnDecision
getDecision()
DmnHitPolicyHandlerRegistry
getHitPolicyHandlerRegistry()
DmnModelInstance
getModelInstance()
java.lang.Object
getParent()
protected java.util.List<DmnDecision>
getRequiredDmnDecisions(Decision decision, java.util.Map<java.lang.String,DmnDecisionImpl> dmnDecisions)
DmnTransform
modelInstance(java.io.File file)
Set the DMN model instance to transform as file.DmnTransform
modelInstance(java.io.InputStream inputStream)
Set the DMN model instance to transform as input stream.DmnTransform
modelInstance(DmnModelInstance modelInstance)
Set the DMN model instance to transform.protected void
notifyTransformListeners(Decision decision, DmnDecision dmnDecision)
protected void
notifyTransformListeners(Definitions definitions, DmnDecisionRequirementsGraphImpl dmnDecisionRequirementsGraph)
protected void
notifyTransformListeners(Input input, DmnDecisionTableInputImpl dmnInput)
protected void
notifyTransformListeners(Output output, DmnDecisionTableOutputImpl dmnOutput)
protected void
notifyTransformListeners(Rule rule, DmnDecisionTableRuleImpl dmnRule)
void
setModelInstance(java.io.File file)
Set the DMN model instance to transform as file.void
setModelInstance(java.io.InputStream inputStream)
Set the DMN model instance to transform as input stream.void
setModelInstance(DmnModelInstance modelInstance)
Set the DMN model instance to transform.protected DmnDecisionImpl
transformDecision(Decision decision)
protected DmnDecisionLiteralExpressionImpl
transformDecisionLiteralExpression(Decision decision, LiteralExpression literalExpression)
<T extends DmnDecisionRequirementsGraph>
TtransformDecisionRequirementsGraph()
Transform the decision requirements graph and all containing decisions of the DMN model instance.<T extends DmnDecision>
java.util.List<T>transformDecisions()
Transform all decisions of the DMN model instance.protected java.util.List<DmnDecision>
transformDecisions(java.util.Collection<Decision> decisions)
protected DmnDecisionTableImpl
transformDecisionTable(DecisionTable decisionTable)
protected DmnDecisionTableInputImpl
transformDecisionTableInput(Input input)
protected DmnDecisionTableOutputImpl
transformDecisionTableOutput(Output output)
protected DmnDecisionTableRuleImpl
transformDecisionTableRule(Rule rule)
protected DmnDecisionRequirementsGraph
transformDefinitions(Definitions definitions)
protected java.util.Map<java.lang.String,DmnDecisionImpl>
transformIndividualDecisions(java.util.Collection<Decision> decisions)
protected DmnExpressionImpl
transformInputEntry(InputEntry inputEntry)
protected DmnExpressionImpl
transformInputExpression(InputExpression inputExpression)
protected DmnExpressionImpl
transformLiteralExpression(LiteralExpression literalExpression)
protected DmnExpressionImpl
transformOutputEntry(OutputEntry outputEntry)
protected DmnVariableImpl
transformVariable(Variable variable)
-
-
-
Field Detail
-
transformer
protected DmnTransformer transformer
-
transformListeners
protected java.util.List<DmnTransformListener> transformListeners
-
handlerRegistry
protected DmnElementTransformHandlerRegistry handlerRegistry
-
modelInstance
protected DmnModelInstance modelInstance
-
parent
protected java.lang.Object parent
-
decision
protected DmnDecisionImpl decision
-
decisionTable
protected DmnDecisionTableImpl decisionTable
-
dataTypeTransformerRegistry
protected DmnDataTypeTransformerRegistry dataTypeTransformerRegistry
-
hitPolicyHandlerRegistry
protected DmnHitPolicyHandlerRegistry hitPolicyHandlerRegistry
-
-
Constructor Detail
-
DefaultDmnTransform
public DefaultDmnTransform(DmnTransformer transformer)
-
-
Method Detail
-
setModelInstance
public void setModelInstance(java.io.File file)
Description copied from interface:DmnTransform
Set the DMN model instance to transform as file.- Specified by:
setModelInstance
in interfaceDmnTransform
- Parameters:
file
- the file of the DMN model instance
-
modelInstance
public DmnTransform modelInstance(java.io.File file)
Description copied from interface:DmnTransform
Set the DMN model instance to transform as file.- Specified by:
modelInstance
in interfaceDmnTransform
- Parameters:
file
- the file of the DMN model instance- Returns:
- this DmnTransform
-
setModelInstance
public void setModelInstance(java.io.InputStream inputStream)
Description copied from interface:DmnTransform
Set the DMN model instance to transform as input stream.- Specified by:
setModelInstance
in interfaceDmnTransform
- Parameters:
inputStream
- the input stream of the DMN model instance
-
modelInstance
public DmnTransform modelInstance(java.io.InputStream inputStream)
Description copied from interface:DmnTransform
Set the DMN model instance to transform as input stream.- Specified by:
modelInstance
in interfaceDmnTransform
- Parameters:
inputStream
- the input stream of the DMN model instance- Returns:
- this DmnTransform
-
setModelInstance
public void setModelInstance(DmnModelInstance modelInstance)
Description copied from interface:DmnTransform
Set the DMN model instance to transform.- Specified by:
setModelInstance
in interfaceDmnTransform
- Parameters:
modelInstance
- the DMN model instance
-
modelInstance
public DmnTransform modelInstance(DmnModelInstance modelInstance)
Description copied from interface:DmnTransform
Set the DMN model instance to transform.- Specified by:
modelInstance
in interfaceDmnTransform
- Parameters:
modelInstance
- the DMN model instance- Returns:
- this DmnTransform
-
transformDecisionRequirementsGraph
public <T extends DmnDecisionRequirementsGraph> T transformDecisionRequirementsGraph()
Description copied from interface:DmnTransform
Transform the decision requirements graph and all containing decisions of the DMN model instance.- Specified by:
transformDecisionRequirementsGraph
in interfaceDmnTransform
-
transformDefinitions
protected DmnDecisionRequirementsGraph transformDefinitions(Definitions definitions)
-
transformDecisions
public <T extends DmnDecision> java.util.List<T> transformDecisions()
Description copied from interface:DmnTransform
Transform all decisions of the DMN model instance.- Specified by:
transformDecisions
in interfaceDmnTransform
-
transformDecisions
protected java.util.List<DmnDecision> transformDecisions(java.util.Collection<Decision> decisions)
-
transformIndividualDecisions
protected java.util.Map<java.lang.String,DmnDecisionImpl> transformIndividualDecisions(java.util.Collection<Decision> decisions)
-
buildDecisionRequirements
protected void buildDecisionRequirements(java.util.Collection<Decision> decisions, java.util.Map<java.lang.String,DmnDecisionImpl> dmnDecisions)
-
ensureNoLoopInDecisions
protected void ensureNoLoopInDecisions(java.util.List<DmnDecision> dmnDecisionList)
-
ensureNoLoopInDecision
protected void ensureNoLoopInDecision(DmnDecision decision, java.util.List<java.lang.String> parentDecisionList, java.util.List<java.lang.String> visitedDecisions)
-
getRequiredDmnDecisions
protected java.util.List<DmnDecision> getRequiredDmnDecisions(Decision decision, java.util.Map<java.lang.String,DmnDecisionImpl> dmnDecisions)
-
transformDecision
protected DmnDecisionImpl transformDecision(Decision decision)
-
transformDecisionTable
protected DmnDecisionTableImpl transformDecisionTable(DecisionTable decisionTable)
-
transformDecisionTableInput
protected DmnDecisionTableInputImpl transformDecisionTableInput(Input input)
-
transformDecisionTableOutput
protected DmnDecisionTableOutputImpl transformDecisionTableOutput(Output output)
-
transformDecisionTableRule
protected DmnDecisionTableRuleImpl transformDecisionTableRule(Rule rule)
-
transformInputExpression
protected DmnExpressionImpl transformInputExpression(InputExpression inputExpression)
-
transformInputEntry
protected DmnExpressionImpl transformInputEntry(InputEntry inputEntry)
-
transformOutputEntry
protected DmnExpressionImpl transformOutputEntry(OutputEntry outputEntry)
-
transformDecisionLiteralExpression
protected DmnDecisionLiteralExpressionImpl transformDecisionLiteralExpression(Decision decision, LiteralExpression literalExpression)
-
transformLiteralExpression
protected DmnExpressionImpl transformLiteralExpression(LiteralExpression literalExpression)
-
transformVariable
protected DmnVariableImpl transformVariable(Variable variable)
-
notifyTransformListeners
protected void notifyTransformListeners(Decision decision, DmnDecision dmnDecision)
-
notifyTransformListeners
protected void notifyTransformListeners(Input input, DmnDecisionTableInputImpl dmnInput)
-
notifyTransformListeners
protected void notifyTransformListeners(Definitions definitions, DmnDecisionRequirementsGraphImpl dmnDecisionRequirementsGraph)
-
notifyTransformListeners
protected void notifyTransformListeners(Output output, DmnDecisionTableOutputImpl dmnOutput)
-
notifyTransformListeners
protected void notifyTransformListeners(Rule rule, DmnDecisionTableRuleImpl dmnRule)
-
getModelInstance
public DmnModelInstance getModelInstance()
- Specified by:
getModelInstance
in interfaceDmnElementTransformContext
- Returns:
- the transformed DMN model instance
-
getParent
public java.lang.Object getParent()
- Specified by:
getParent
in interfaceDmnElementTransformContext
- Returns:
- the already transformed parent of the current transformed element
-
getDecision
public DmnDecision getDecision()
- Specified by:
getDecision
in interfaceDmnElementTransformContext
- Returns:
- the already transformed decision to which the current transformed element belongs
-
getDataTypeTransformerRegistry
public DmnDataTypeTransformerRegistry getDataTypeTransformerRegistry()
- Specified by:
getDataTypeTransformerRegistry
in interfaceDmnElementTransformContext
- Returns:
- the
DmnDataTypeTransformerRegistry
to use
-
getHitPolicyHandlerRegistry
public DmnHitPolicyHandlerRegistry getHitPolicyHandlerRegistry()
- Specified by:
getHitPolicyHandlerRegistry
in interfaceDmnElementTransformContext
- Returns:
- the
DmnHitPolicyHandlerRegistry
to use
-
-