Search in sources :

Example 46 with ItemDefinition

use of org.kie.workbench.common.dmn.api.definition.v1_1.ItemDefinition in project drools by kiegroup.

the class ItemDefinitionDependenciesTest method testOrdering3.

@Test
public void testOrdering3() {
    ItemDefinition tNumberList = build("tNumberList");
    ItemDefinition tTax = build("tTax");
    ItemDefinition tStateModel = build("tStateModel");
    ItemDefinition tTaxList = build("tTaxList", tTax);
    ItemDefinition tCategory = build("tCategory");
    ItemDefinition tItem = build("tItem", tCategory);
    ItemDefinition tItemList = build("tItemList", tItem);
    ItemDefinition tOrder = build("tOrder", tItemList);
    List<ItemDefinition> originalList = Arrays.asList(new ItemDefinition[] { tOrder, tItem, tCategory, tNumberList, tItemList, tTax, tStateModel, tTaxList });
    List<ItemDefinition> orderedList = orderingStrategy(originalList);
    assertTrue("Index of tCategory < tItem", orderedList.indexOf(tCategory) < orderedList.indexOf(tItem));
    assertTrue("Index of tItem < tItemList", orderedList.indexOf(tItem) < orderedList.indexOf(tItemList));
    assertTrue("Index of tItemList < tOrder", orderedList.indexOf(tItemList) < orderedList.indexOf(tOrder));
    assertTrue("Index of tTax < tTaxList", orderedList.indexOf(tTax) < orderedList.indexOf(tTaxList));
}
Also used : ItemDefinition(org.kie.dmn.model.v1_1.ItemDefinition) Test(org.junit.Test)

Example 47 with ItemDefinition

use of org.kie.workbench.common.dmn.api.definition.v1_1.ItemDefinition in project drools by kiegroup.

the class ItemDefinitionDependenciesTest method testOrdering2.

@Test
public void testOrdering2() {
    ItemDefinition tMortgageType = build("tMortgageType");
    ItemDefinition tObjective = build("tObjective");
    ItemDefinition tRequested = build("tRequested", tMortgageType, tObjective);
    ItemDefinition tProduct = build("tProduct");
    ItemDefinition tProductCollection = build("tProductCollection", tProduct);
    ItemDefinition tConformanceType = build("tConformanceType");
    ItemDefinition tLoanTypes = build("tLoanTypes", tMortgageType, tConformanceType);
    List<ItemDefinition> originalList = Arrays.asList(new ItemDefinition[] { tRequested, tProduct, tProductCollection, tMortgageType, tObjective, tConformanceType, tLoanTypes });
    List<ItemDefinition> orderedList = orderingStrategy(originalList);
    assertTrue("Index of tMortgageType < tRequested", orderedList.indexOf(tMortgageType) < orderedList.indexOf(tRequested));
    assertTrue("Index of tObjective < tRequested", orderedList.indexOf(tObjective) < orderedList.indexOf(tRequested));
    assertTrue("Index of tProduct < tProductCollection", orderedList.indexOf(tProduct) < orderedList.indexOf(tProductCollection));
    assertTrue("Index of tMortgageType < tLoanTypes", orderedList.indexOf(tMortgageType) < orderedList.indexOf(tLoanTypes));
    assertTrue("Index of tConformanceType < tLoanTypes", orderedList.indexOf(tConformanceType) < orderedList.indexOf(tLoanTypes));
}
Also used : ItemDefinition(org.kie.dmn.model.v1_1.ItemDefinition) Test(org.junit.Test)

Aggregations

ItemDefinition (org.kie.dmn.model.v1_1.ItemDefinition)22 ItemDefinition (org.eclipse.bpmn2.ItemDefinition)21 ArrayList (java.util.ArrayList)17 RootElement (org.eclipse.bpmn2.RootElement)13 Message (org.eclipse.bpmn2.Message)10 AdHocSubProcess (org.eclipse.bpmn2.AdHocSubProcess)9 Process (org.eclipse.bpmn2.Process)9 SubProcess (org.eclipse.bpmn2.SubProcess)9 Test (org.junit.Test)9 List (java.util.List)7 Entry (java.util.Map.Entry)7 SimpleFeatureMapEntry (org.eclipse.emf.ecore.impl.EStructuralFeatureImpl.SimpleFeatureMapEntry)7 QName (javax.xml.namespace.QName)6 FlowElement (org.eclipse.bpmn2.FlowElement)6 FeatureMap (org.eclipse.emf.ecore.util.FeatureMap)6 ServiceTask (org.eclipse.bpmn2.ServiceTask)5 DataInput (org.eclipse.bpmn2.DataInput)4 DataOutput (org.eclipse.bpmn2.DataOutput)4 FlowElementsContainer (org.eclipse.bpmn2.FlowElementsContainer)4 Interface (org.eclipse.bpmn2.Interface)4