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 DmnDataTypeTransformerRegistrydataTypeTransformerRegistryprotected DmnDecisionImpldecisionprotected DmnDecisionTableImpldecisionTableprotected DmnElementTransformHandlerRegistryhandlerRegistryprotected DmnHitPolicyHandlerRegistryhitPolicyHandlerRegistryprotected DmnModelInstancemodelInstanceprotected java.lang.Objectparentprotected DmnTransformertransformerprotected 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 voidbuildDecisionRequirements(java.util.Collection<Decision> decisions, java.util.Map<java.lang.String,DmnDecisionImpl> dmnDecisions)protected voidensureNoLoopInDecision(DmnDecision decision, java.util.List<java.lang.String> parentDecisionList, java.util.List<java.lang.String> visitedDecisions)protected voidensureNoLoopInDecisions(java.util.List<DmnDecision> dmnDecisionList)DmnDataTypeTransformerRegistrygetDataTypeTransformerRegistry()DmnDecisiongetDecision()DmnHitPolicyHandlerRegistrygetHitPolicyHandlerRegistry()DmnModelInstancegetModelInstance()java.lang.ObjectgetParent()protected java.util.List<DmnDecision>getRequiredDmnDecisions(Decision decision, java.util.Map<java.lang.String,DmnDecisionImpl> dmnDecisions)DmnTransformmodelInstance(java.io.File file)Set the DMN model instance to transform as file.DmnTransformmodelInstance(java.io.InputStream inputStream)Set the DMN model instance to transform as input stream.DmnTransformmodelInstance(DmnModelInstance modelInstance)Set the DMN model instance to transform.protected voidnotifyTransformListeners(Decision decision, DmnDecision dmnDecision)protected voidnotifyTransformListeners(Definitions definitions, DmnDecisionRequirementsGraphImpl dmnDecisionRequirementsGraph)protected voidnotifyTransformListeners(Input input, DmnDecisionTableInputImpl dmnInput)protected voidnotifyTransformListeners(Output output, DmnDecisionTableOutputImpl dmnOutput)protected voidnotifyTransformListeners(Rule rule, DmnDecisionTableRuleImpl dmnRule)voidsetModelInstance(java.io.File file)Set the DMN model instance to transform as file.voidsetModelInstance(java.io.InputStream inputStream)Set the DMN model instance to transform as input stream.voidsetModelInstance(DmnModelInstance modelInstance)Set the DMN model instance to transform.protected DmnDecisionImpltransformDecision(Decision decision)protected DmnDecisionLiteralExpressionImpltransformDecisionLiteralExpression(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 DmnDecisionTableImpltransformDecisionTable(DecisionTable decisionTable)protected DmnDecisionTableInputImpltransformDecisionTableInput(Input input)protected DmnDecisionTableOutputImpltransformDecisionTableOutput(Output output)protected DmnDecisionTableRuleImpltransformDecisionTableRule(Rule rule)protected DmnDecisionRequirementsGraphtransformDefinitions(Definitions definitions)protected java.util.Map<java.lang.String,DmnDecisionImpl>transformIndividualDecisions(java.util.Collection<Decision> decisions)protected DmnExpressionImpltransformInputEntry(InputEntry inputEntry)protected DmnExpressionImpltransformInputExpression(InputExpression inputExpression)protected DmnExpressionImpltransformLiteralExpression(LiteralExpression literalExpression)protected DmnExpressionImpltransformOutputEntry(OutputEntry outputEntry)protected DmnVariableImpltransformVariable(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:DmnTransformSet the DMN model instance to transform as file.- Specified by:
setModelInstancein interfaceDmnTransform- Parameters:
file- the file of the DMN model instance
-
modelInstance
public DmnTransform modelInstance(java.io.File file)
Description copied from interface:DmnTransformSet the DMN model instance to transform as file.- Specified by:
modelInstancein 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:DmnTransformSet the DMN model instance to transform as input stream.- Specified by:
setModelInstancein interfaceDmnTransform- Parameters:
inputStream- the input stream of the DMN model instance
-
modelInstance
public DmnTransform modelInstance(java.io.InputStream inputStream)
Description copied from interface:DmnTransformSet the DMN model instance to transform as input stream.- Specified by:
modelInstancein interfaceDmnTransform- Parameters:
inputStream- the input stream of the DMN model instance- Returns:
- this DmnTransform
-
setModelInstance
public void setModelInstance(DmnModelInstance modelInstance)
Description copied from interface:DmnTransformSet the DMN model instance to transform.- Specified by:
setModelInstancein interfaceDmnTransform- Parameters:
modelInstance- the DMN model instance
-
modelInstance
public DmnTransform modelInstance(DmnModelInstance modelInstance)
Description copied from interface:DmnTransformSet the DMN model instance to transform.- Specified by:
modelInstancein interfaceDmnTransform- Parameters:
modelInstance- the DMN model instance- Returns:
- this DmnTransform
-
transformDecisionRequirementsGraph
public <T extends DmnDecisionRequirementsGraph> T transformDecisionRequirementsGraph()
Description copied from interface:DmnTransformTransform the decision requirements graph and all containing decisions of the DMN model instance.- Specified by:
transformDecisionRequirementsGraphin interfaceDmnTransform
-
transformDefinitions
protected DmnDecisionRequirementsGraph transformDefinitions(Definitions definitions)
-
transformDecisions
public <T extends DmnDecision> java.util.List<T> transformDecisions()
Description copied from interface:DmnTransformTransform all decisions of the DMN model instance.- Specified by:
transformDecisionsin 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:
getModelInstancein interfaceDmnElementTransformContext- Returns:
- the transformed DMN model instance
-
getParent
public java.lang.Object getParent()
- Specified by:
getParentin interfaceDmnElementTransformContext- Returns:
- the already transformed parent of the current transformed element
-
getDecision
public DmnDecision getDecision()
- Specified by:
getDecisionin interfaceDmnElementTransformContext- Returns:
- the already transformed decision to which the current transformed element belongs
-
getDataTypeTransformerRegistry
public DmnDataTypeTransformerRegistry getDataTypeTransformerRegistry()
- Specified by:
getDataTypeTransformerRegistryin interfaceDmnElementTransformContext- Returns:
- the
DmnDataTypeTransformerRegistryto use
-
getHitPolicyHandlerRegistry
public DmnHitPolicyHandlerRegistry getHitPolicyHandlerRegistry()
- Specified by:
getHitPolicyHandlerRegistryin interfaceDmnElementTransformContext- Returns:
- the
DmnHitPolicyHandlerRegistryto use
-
-