Search in sources :

Example 91 with Context

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);
}
Also used : Context(org.kie.workbench.common.dmn.api.definition.v1_1.Context) LiteralExpression(org.kie.workbench.common.dmn.api.definition.v1_1.LiteralExpression) InformationItem(org.kie.workbench.common.dmn.api.definition.v1_1.InformationItem) ContextEntry(org.kie.workbench.common.dmn.api.definition.v1_1.ContextEntry) Name(org.kie.workbench.common.dmn.api.property.dmn.Name) HasName(org.kie.workbench.common.dmn.api.definition.HasName)

Example 92 with 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);
}
Also used : Context(org.kie.workbench.common.dmn.api.definition.v1_1.Context) GraphCommandExecutionContext(org.kie.workbench.common.stunner.core.graph.command.GraphCommandExecutionContext) DMNGridData(org.kie.workbench.common.dmn.client.widgets.grid.model.DMNGridData) Before(org.junit.Before)

Example 93 with Context

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);
        }
    }
}
Also used : ExtensionElements(org.kie.dmn.model.v1_1.DMNElement.ExtensionElements)

Example 94 with Context

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);
}
Also used : ImportedValues(org.kie.dmn.model.v1_1.ImportedValues)

Example 95 with Context

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);
    }
}
Also used : InformationRequirement(org.kie.dmn.model.v1_1.InformationRequirement)

Aggregations

Context (org.eclipse.jst.server.tomcat.core.internal.xml.server40.Context)58 Context (com.microsoft.z3.Context)36 CoreException (org.eclipse.core.runtime.CoreException)34 Test (org.junit.Test)29 List (java.util.List)24 BoolExpr (com.microsoft.z3.BoolExpr)23 HashMap (java.util.HashMap)20 IOException (java.io.IOException)18 Map (java.util.Map)18 ArrayList (java.util.ArrayList)17 ServerInstance (org.eclipse.jst.server.tomcat.core.internal.xml.server40.ServerInstance)17 Context (org.kie.workbench.common.dmn.api.definition.v1_1.Context)17 DMNMessage (org.kie.dmn.api.core.DMNMessage)14 File (java.io.File)13 Solver (com.microsoft.z3.Solver)12 Status (com.microsoft.z3.Status)12 IPath (org.eclipse.core.runtime.IPath)11 IStatus (org.eclipse.core.runtime.IStatus)11 Status (org.eclipse.core.runtime.Status)11 Factory (org.eclipse.jst.server.tomcat.core.internal.xml.Factory)11