use of org.kie.dmn.model.v1_1.Context in project kie-wb-common by kiegroup.
the class JavaFunctionEditorDefinition method getModelClass.
@Override
public Optional<Context> getModelClass() {
final Context context = new Context();
final ContextEntry classEntry = new ContextEntry();
final InformationItem classEntryVariable = new InformationItem();
classEntryVariable.setName(new Name(VARIABLE_CLASS));
classEntry.setVariable(classEntryVariable);
classEntry.setExpression(new LiteralExpression());
context.getContextEntry().add(classEntry);
final ContextEntry methodSignatureEntry = new ContextEntry();
final InformationItem methodSignatureEntryVariable = new InformationItem();
methodSignatureEntryVariable.setName(new Name(VARIABLE_METHOD_SIGNATURE));
methodSignatureEntry.setVariable(methodSignatureEntryVariable);
methodSignatureEntry.setExpression(new LiteralExpression());
context.getContextEntry().add(methodSignatureEntry);
return Optional.of(context);
}
use of org.kie.dmn.model.v1_1.Context in project kie-wb-common by kiegroup.
the class MoveRowsCommandTest method setup.
@Before
public void setup() {
this.context = new Context();
this.uiModel = new DMNGridData();
doReturn(ruleManager).when(handler).getRuleManager();
doReturn(0).when(uiRowNumberColumn).getIndex();
doReturn(1).when(uiNameColumn).getIndex();
doReturn(2).when(uiExpressionEditorColumn).getIndex();
addContextEntry(II1);
addContextEntry(II2);
addUiModelColumn(uiRowNumberColumn);
addUiModelColumn(uiNameColumn);
addUiModelColumn(uiExpressionEditorColumn);
addUiModelRow(0);
addUiModelRow(1);
}
use of org.kie.dmn.model.v1_1.Context in project drools by kiegroup.
the class ExtensionElementsConverter method writeChildren.
@Override
protected void writeChildren(HierarchicalStreamWriter writer, MarshallingContext context, Object parent) {
super.writeChildren(writer, context, parent);
if (extensionRegisters.size() == 0) {
return;
}
ExtensionElements ee = (ExtensionElements) parent;
if (ee.getAny() != null) {
for (Object a : ee.getAny()) {
writeItem(a, context, writer);
}
}
}
use of org.kie.dmn.model.v1_1.Context in project drools by kiegroup.
the class ImportedValuesConverter method writeChildren.
@Override
protected void writeChildren(HierarchicalStreamWriter writer, MarshallingContext context, Object parent) {
super.writeChildren(writer, context, parent);
ImportedValues iv = (ImportedValues) parent;
writeChildrenNode(writer, context, iv.getImportedElement(), IMPORTED_ELEMENT);
}
use of org.kie.dmn.model.v1_1.Context in project drools by kiegroup.
the class InformationRequirementConverter method writeChildren.
@Override
protected void writeChildren(HierarchicalStreamWriter writer, MarshallingContext context, Object parent) {
super.writeChildren(writer, context, parent);
InformationRequirement ir = (InformationRequirement) parent;
if (ir.getRequiredDecision() != null) {
writeChildrenNode(writer, context, ir.getRequiredDecision(), REQUIRED_DECISION);
}
// TODO or if else ?
if (ir.getRequiredInput() != null) {
writeChildrenNode(writer, context, ir.getRequiredInput(), REQUIRED_INPUT);
}
}
Aggregations