public abstract class AbstractKogitoDMNService extends Object implements KogitoDMNService
Most of this code is cloned/adapted from ScenarioSimulation backend and dmn core
Modifier and Type | Field and Description |
---|---|
protected static QName |
TYPEREF_QNAME |
static String |
URI_FEEL |
static String |
WRONG_DMN_MESSAGE |
Constructor and Description |
---|
AbstractKogitoDMNService() |
Modifier and Type | Method and Description |
---|---|
protected void |
checkTypeSupport(ClientDMNType type,
org.drools.workbench.screens.scenariosimulation.kogito.client.dmn.AbstractKogitoDMNService.ErrorHolder errorHolder,
String fullPropertyPath)
Recursively visit a composite
DMNType to eventually detect and add errors to given ErrorHolder |
protected ClientDMNType |
createDMNType(Map<String,org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITItemDefinition> allDefinitions,
org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITItemDefinition itemDefinition,
String namespace,
Map<String,ClientDMNType> dmnTypesDataMap)
This method creates a
ClientDMNType object of a given JSITItemDefinition object or
a JSITItemComponent as well. |
protected FactModelTree |
createFactModelTreeForCollection(Map<String,List<String>> genericTypeInfoMap,
String factName,
ClientDMNType type,
SortedMap<String,FactModelTree> hiddenFacts,
FactModelTree.Type fmType,
List<String> alreadyVisited)
Creates a
FactModelTree for DMNType where DMNType.isCollection() == true |
protected FactModelTree |
createFactModelTreeForComposite(Map<String,List<String>> genericTypeInfoMap,
String name,
String fullPropertyPath,
ClientDMNType type,
SortedMap<String,FactModelTree> hiddenFacts,
FactModelTree.Type fmType,
List<String> alreadyVisited)
Creates a
FactModelTree for DMNType where DMNType.isComposite() == true |
protected FactModelTree |
createFactModelTreeForGenericType(Map<String,List<String>> genericTypeInfoMap,
String factName,
String propertyName,
String fullPropertyPath,
ClientDMNType type,
SortedMap<String,FactModelTree> hiddenFacts,
FactModelTree.Type fmType,
List<String> alreadyVisited)
Creates a
FactModelTree for DMNType |
protected FactModelTree |
createFactModelTreeForNoCollection(Map<String,List<String>> genericTypeInfoMap,
String factName,
String propertyName,
String fullPropertyPath,
ClientDMNType type,
SortedMap<String,FactModelTree> hiddenFacts,
FactModelTree.Type fmType,
List<String> alreadyVisited)
Creates a
FactModelTree for DMNType where DMNType.isCollection() ! |
protected FactModelTree |
createFactModelTreeForSimple(Map<String,List<String>> genericTypeInfoMap,
String factName,
String propertyClass,
FactModelTree.Type fmType)
Creates a
FactModelTree for DMNType where DMNType.isComposite() ! |
protected FactModelTree |
createTopLevelFactModelTree(String factName,
ClientDMNType type,
SortedMap<String,FactModelTree> hiddenFacts,
FactModelTree.Type fmType)
This method is the entry point for
FactModelTree . |
protected Map<String,ClientDMNType> |
getDMNDataTypesMap(List<org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITItemDefinition> jsitItemDefinitions,
String nameSpace)
This method retrieves all DMN Data Types are composed by
- DEFAULT types, listed inside
BuiltInType enum
- CUSTOM types, which are available inside jsitItemDefinitions list |
protected ClientDMNType |
getDMNTypeFromMaps(Map<String,ClientDMNType> dmnTypesMap,
Map<QName,String> source)
It retrieves the
ClientDMNType of the current typeRef source (Decision or Input Data). |
FactModelTuple |
getFactModelTuple(org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITDefinitions jsitDefinitions) |
Map<QName,String> |
getOtherAttributesMap(org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITDMNElement jsitInputDataVariable) |
protected void |
internalCheckTypeSupport(ClientDMNType type,
boolean alreadyInCollection,
org.drools.workbench.screens.scenariosimulation.kogito.client.dmn.AbstractKogitoDMNService.ErrorHolder errorHolder,
String fullPropertyPath,
Set<String> alreadyVisited) |
boolean |
isJSITDecision(org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITDRGElement jsitdrgElement) |
boolean |
isJSITInputData(org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITDRGElement jsitdrgElement) |
protected boolean |
isToBeManagedAsCollection(ClientDMNType type)
Return
true if the given DMNType has to be managed as collection |
protected boolean |
isToBeManagedAsComposite(ClientDMNType type)
Return
true if the given DMNType has to be managed as composite |
protected String |
populateGeneric(Map<String,List<String>> genericTypeInfoMap,
String fullPropertyPath,
String type)
This method map the given name to List.class.getCanonicalName() inside simpleFields,
and map name to a singleton list containing a newly generated key (path + "." + type) inside genericTypeInfoMap
|
protected void |
populateItemDefinitionFields(Map<String,org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITItemDefinition> allItemDefinitions,
org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITItemDefinition itemDefinition,
String namespace,
Map<String,ClientDMNType> dmnTypesMap,
ClientDMNType clientDMNType)
This method aim is to populate all fields and subfields present in a given
JSITItemDefinitionItem
Considering a field can contains subfields, this method is *recursive*. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getDMNContent
public static final String URI_FEEL
public static final String WRONG_DMN_MESSAGE
protected static final QName TYPEREF_QNAME
public FactModelTuple getFactModelTuple(org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITDefinitions jsitDefinitions)
getFactModelTuple
in interface KogitoDMNService
protected ClientDMNType getDMNTypeFromMaps(Map<String,ClientDMNType> dmnTypesMap, Map<QName,String> source)
ClientDMNType
of the current typeRef source (Decision or Input Data).
If the source has an empty typeRef, the default value BuiltInType.ANY
is assigned.dmnTypesMap
- source
- protected Map<String,ClientDMNType> getDMNDataTypesMap(List<org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITItemDefinition> jsitItemDefinitions, String nameSpace)
BuiltInType
enum
- CUSTOM types, which are available inside jsitItemDefinitions
listjsitItemDefinitions
- List of CUSTOM Data Type in raw formatnameSpace
- namespaceprotected ClientDMNType createDMNType(Map<String,org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITItemDefinition> allDefinitions, org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITItemDefinition itemDefinition, String namespace, Map<String,ClientDMNType> dmnTypesDataMap)
ClientDMNType
object of a given JSITItemDefinition
object or
a JSITItemComponent
as well.allDefinitions
- itemDefinition
- namespace
- dmnTypesDataMap
- protected void populateItemDefinitionFields(Map<String,org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITItemDefinition> allItemDefinitions, org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITItemDefinition itemDefinition, String namespace, Map<String,ClientDMNType> dmnTypesMap, ClientDMNType clientDMNType)
JSITItemDefinitionItem
Considering a field can contains subfields, this method is *recursive*. Be sure an exit condition is correctly set.
Currently, the methods exits if there are not fields inside the given itemDefinition.allItemDefinitions
- itemDefinition
- namespace
- dmnTypesMap
- clientDMNType
- protected void checkTypeSupport(ClientDMNType type, org.drools.workbench.screens.scenariosimulation.kogito.client.dmn.AbstractKogitoDMNService.ErrorHolder errorHolder, String fullPropertyPath)
DMNType
to eventually detect and add errors to given ErrorHolder
type
- errorHolder
- fullPropertyPath
- protected void internalCheckTypeSupport(ClientDMNType type, boolean alreadyInCollection, org.drools.workbench.screens.scenariosimulation.kogito.client.dmn.AbstractKogitoDMNService.ErrorHolder errorHolder, String fullPropertyPath, Set<String> alreadyVisited)
type
- alreadyInCollection
- errorHolder
- fullPropertyPath
- alreadyVisited
- protected FactModelTree createTopLevelFactModelTree(String factName, ClientDMNType type, SortedMap<String,FactModelTree> hiddenFacts, FactModelTree.Type fmType)
FactModelTree
. It is the one to be called from the very top level DMNType
factName
- type
- hiddenFacts
- fmType
- protected boolean isToBeManagedAsCollection(ClientDMNType type)
true
if the given DMNType
has to be managed as collectiontype
- true
if DMNType.isCollection() == true
and BaseDMNTypeImpl.getFeelType() != BuiltInType.UNKNOWN
protected boolean isToBeManagedAsComposite(ClientDMNType type)
true
if the given DMNType
has to be managed as compositetype
- true
if DMNType.isCollection() == true
and BaseDMNTypeImpl.getFeelType() != BuiltInType.UNKNOWN
protected FactModelTree createFactModelTreeForCollection(Map<String,List<String>> genericTypeInfoMap, String factName, ClientDMNType type, SortedMap<String,FactModelTree> hiddenFacts, FactModelTree.Type fmType, List<String> alreadyVisited)
FactModelTree
for DMNType
where DMNType.isCollection()
== true
genericTypeInfoMap
- factName
- type
- hiddenFacts
- fmType
- alreadyVisited
- Exception
- if DMNType.isCollection()
!= true
protected String populateGeneric(Map<String,List<String>> genericTypeInfoMap, String fullPropertyPath, String type)
genericTypeInfoMap
- fullPropertyPath
- type
- protected FactModelTree createFactModelTreeForNoCollection(Map<String,List<String>> genericTypeInfoMap, String factName, String propertyName, String fullPropertyPath, ClientDMNType type, SortedMap<String,FactModelTree> hiddenFacts, FactModelTree.Type fmType, List<String> alreadyVisited)
FactModelTree
for DMNType
where DMNType.isCollection()
!= true
genericTypeInfoMap
- factName
- propertyName
- fullPropertyPath
- type
- hiddenFacts
- fmType
- alreadyVisited
- Exception
- if DMNType.isCollection()
== true
protected FactModelTree createFactModelTreeForGenericType(Map<String,List<String>> genericTypeInfoMap, String factName, String propertyName, String fullPropertyPath, ClientDMNType type, SortedMap<String,FactModelTree> hiddenFacts, FactModelTree.Type fmType, List<String> alreadyVisited)
FactModelTree
for DMNType
genericTypeInfoMap
- factName
- propertyName
- fullPropertyPath
- type
- hiddenFacts
- fmType
- alreadyVisited
- Exception
protected FactModelTree createFactModelTreeForSimple(Map<String,List<String>> genericTypeInfoMap, String factName, String propertyClass, FactModelTree.Type fmType)
FactModelTree
for DMNType
where DMNType.isComposite()
!= true
.
Returned FactModelTree
will have only one single property, whose name is VALUE and whose value is the given propertyClassgenericTypeInfoMap
- factName
- propertyClass
- fmType
- protected FactModelTree createFactModelTreeForComposite(Map<String,List<String>> genericTypeInfoMap, String name, String fullPropertyPath, ClientDMNType type, SortedMap<String,FactModelTree> hiddenFacts, FactModelTree.Type fmType, List<String> alreadyVisited)
FactModelTree
for DMNType
where DMNType.isComposite()
== true
genericTypeInfoMap
- name
- fullPropertyPath
- type
- hiddenFacts
- fmType
- alreadyVisited
- Exception
- if DMNType.isComposite()
!= true
public boolean isJSITInputData(org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITDRGElement jsitdrgElement)
public boolean isJSITDecision(org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITDRGElement jsitdrgElement)
Copyright © 2001–2020 JBoss by Red Hat. All rights reserved.