Search in sources :

Example 6 with FactAssignmentField

use of org.drools.workbench.models.testscenarios.shared.FactAssignmentField in project drools-wb by kiegroup.

the class FieldSelectorWidget method createField.

private Field createField(final SelectionEvent<Integer> selectionEvent) {
    if (selectionEvent.getSelectedItem() == FieldData.TYPE_FACT) {
        return new FactAssignmentField(field.getName(), helper.getFieldType());
    } else {
        if (selectionEvent.getSelectedItem() == FieldData.TYPE_COLLECTION) {
            CollectionFieldData collectionFieldData = new CollectionFieldData();
            collectionFieldData.setName(field.getName());
            return collectionFieldData;
        } else {
            FieldData fieldData = new FieldData(field.getName(), "");
            fieldData.setNature(selectionEvent.getSelectedItem());
            return fieldData;
        }
    }
}
Also used : CollectionFieldData(org.drools.workbench.models.testscenarios.shared.CollectionFieldData) FieldData(org.drools.workbench.models.testscenarios.shared.FieldData) FactAssignmentField(org.drools.workbench.models.testscenarios.shared.FactAssignmentField) CollectionFieldData(org.drools.workbench.models.testscenarios.shared.CollectionFieldData)

Aggregations

FactAssignmentField (org.drools.workbench.models.testscenarios.shared.FactAssignmentField)6 Test (org.junit.Test)4 ClassTypeResolver (org.kie.soup.project.datamodel.commons.types.ClassTypeResolver)3 TypeResolver (org.kie.soup.project.datamodel.commons.types.TypeResolver)3 Mouse (org.drools.workbench.models.testscenarios.backend.Mouse)2 FieldData (org.drools.workbench.models.testscenarios.shared.FieldData)2 MatryoshkaDoll (org.drools.workbench.models.testscenarios.backend.MatryoshkaDoll)1 CollectionFieldData (org.drools.workbench.models.testscenarios.shared.CollectionFieldData)1 Fact (org.drools.workbench.models.testscenarios.shared.Fact)1