Search in sources :

Example 16 with PortableWorkDefinition

use of org.drools.workbench.models.datamodel.workitems.PortableWorkDefinition in project drools-wb by kiegroup.

the class GuidedDecisionTableModellerPresenterTest method makeDecisionTableContent.

private GuidedDecisionTableEditorContent makeDecisionTableContent() {
    final GuidedDecisionTable52 model = mock(GuidedDecisionTable52.class);
    final PackageDataModelOracleBaselinePayload dmoBaseline = mock(PackageDataModelOracleBaselinePayload.class);
    final Set<PortableWorkDefinition> workItemDefinitions = Collections.emptySet();
    final Overview overview = mock(Overview.class);
    final GuidedDecisionTableEditorContent dtContent = new GuidedDecisionTableEditorContent(model, workItemDefinitions, overview, dmoBaseline);
    return dtContent;
}
Also used : GuidedDecisionTable52(org.drools.workbench.models.guided.dtable.shared.model.GuidedDecisionTable52) PackageDataModelOracleBaselinePayload(org.kie.workbench.common.services.datamodel.model.PackageDataModelOracleBaselinePayload) PortableWorkDefinition(org.drools.workbench.models.datamodel.workitems.PortableWorkDefinition) GuidedDecisionTableEditorContent(org.drools.workbench.screens.guided.dtable.model.GuidedDecisionTableEditorContent) Overview(org.guvnor.common.services.shared.metadata.model.Overview)

Example 17 with PortableWorkDefinition

use of org.drools.workbench.models.datamodel.workitems.PortableWorkDefinition in project drools-wb by kiegroup.

the class GuidedDecisionTablePresenter_AuditLogTest method setupPresenter.

private void setupPresenter() {
    dtPresenter = new GuidedDecisionTablePresenter(identity, null, null, null, null, null, refreshAttributesPanelEvent, refreshMetaDataPanelEvent, refreshConditionsPanelEvent, refreshActionsPanelEvent, refreshMenusEvent, null, null, gridWidgetColumnFactory, oracleFactory, synchronizer, beanManager, lockManager, null, null, decisionTableAnalyzerProvider, enumLoaderUtilities, pluginHandler, authorizationManager, sessionInfo) {

        @Override
        void initialiseLockManager() {
        // Do nothing for tests
        }

        @Override
        GuidedDecisionTableView makeView(final Set<PortableWorkDefinition> workItemDefinitions) {
            return view;
        }

        @Override
        void initialiseModels() {
        // Do nothing for tests
        }
    };
    final AsyncPackageDataModelOracle dmo = mock(AsyncPackageDataModelOracle.class);
    final PackageDataModelOracleBaselinePayload dmoBaseline = mock(PackageDataModelOracleBaselinePayload.class);
    final Set<PortableWorkDefinition> workItemDefinitions = Collections.emptySet();
    final Overview overview = mock(Overview.class);
    dtContent = new GuidedDecisionTableEditorContent(model, workItemDefinitions, overview, dmoBaseline);
    when(oracleFactory.makeAsyncPackageDataModelOracle(any(Path.class), any(GuidedDecisionTable52.class), eq(dmoBaseline))).thenReturn(dmo);
    dtPresenter.setContent(null, mock(PlaceRequest.class), dtContent, modellerPresenter, false);
    when(view.getLayer()).thenReturn(mock(Layer.class));
}
Also used : AsyncPackageDataModelOracle(org.kie.workbench.common.widgets.client.datamodel.AsyncPackageDataModelOracle) Path(org.uberfire.backend.vfs.Path) PlaceRequest(org.uberfire.mvp.PlaceRequest) GuidedDecisionTable52(org.drools.workbench.models.guided.dtable.shared.model.GuidedDecisionTable52) GuidedDecisionTableEditorContent(org.drools.workbench.screens.guided.dtable.model.GuidedDecisionTableEditorContent) Overview(org.guvnor.common.services.shared.metadata.model.Overview) Layer(com.ait.lienzo.client.core.shape.Layer) PackageDataModelOracleBaselinePayload(org.kie.workbench.common.services.datamodel.model.PackageDataModelOracleBaselinePayload) PortableWorkDefinition(org.drools.workbench.models.datamodel.workitems.PortableWorkDefinition)

Example 18 with PortableWorkDefinition

use of org.drools.workbench.models.datamodel.workitems.PortableWorkDefinition in project drools-wb by kiegroup.

the class ActionWorkItemExecuteColumnConverterTest method getColumn.

@Override
protected BaseColumn getColumn() {
    final ActionWorkItemCol52 column = new ActionWorkItemCol52();
    final PortableWorkDefinition pwd = new PortableWorkDefinition();
    pwd.setName(WID_NAME);
    column.setWorkItemDefinition(pwd);
    column.setHeader(HEADER);
    column.setWidth(WIDTH);
    return column;
}
Also used : ActionWorkItemCol52(org.drools.workbench.models.guided.dtable.shared.model.ActionWorkItemCol52) PortableWorkDefinition(org.drools.workbench.models.datamodel.workitems.PortableWorkDefinition)

Example 19 with PortableWorkDefinition

use of org.drools.workbench.models.datamodel.workitems.PortableWorkDefinition in project drools-wb by kiegroup.

the class WorkItemPageTest method testShowParametersWhenItHasWorkItemDefinitionParametersAreEnabled.

@Test
public void testShowParametersWhenItHasWorkItemDefinitionParametersAreEnabled() {
    final PortableWorkDefinition workDefinition = mock(PortableWorkDefinition.class);
    when(plugin.getWorkItemDefinition()).thenReturn(workDefinition);
    page.enableParameters();
    page.showParameters();
    verify(view).showParameters(any());
}
Also used : PortableWorkDefinition(org.drools.workbench.models.datamodel.workitems.PortableWorkDefinition) Test(org.junit.Test)

Example 20 with PortableWorkDefinition

use of org.drools.workbench.models.datamodel.workitems.PortableWorkDefinition in project drools-wb by kiegroup.

the class ActionWorkItemPluginTest method testForEachWorkItemWhenOneHasBeenExecutedNewColumn.

@Test
public void testForEachWorkItemWhenOneHasBeenExecutedNewColumn() {
    final PortableWorkDefinition workItem1 = getMock("workItem1");
    final PortableWorkDefinition workItem2 = getMock("workItem2");
    final HashMap<String, String> actualWorkItems = new HashMap<>();
    final HashMap<String, String> expectedWorkItems = new HashMap<String, String>() {

        {
            put("workItem2", "workItem2");
        }
    };
    final HashSet<PortableWorkDefinition> fakeDefinitions = new HashSet<PortableWorkDefinition>() {

        {
            add(workItem1);
            add(workItem2);
        }
    };
    when(presenter.getWorkItemDefinitions()).thenReturn(fakeDefinitions);
    when(presenter.getModel()).thenReturn(model);
    when(model.getActionCols()).thenReturn(Collections.singletonList(new ActionWorkItemCol52() {

        {
            setWorkItemDefinition(workItem1);
        }
    }));
    when(plugin.isNewColumn()).thenReturn(true);
    plugin.forEachWorkItem(actualWorkItems::put);
    assertEquals(expectedWorkItems, actualWorkItems);
}
Also used : ActionWorkItemCol52(org.drools.workbench.models.guided.dtable.shared.model.ActionWorkItemCol52) HashMap(java.util.HashMap) PortableWorkDefinition(org.drools.workbench.models.datamodel.workitems.PortableWorkDefinition) HashSet(java.util.HashSet) Test(org.junit.Test)

Aggregations

PortableWorkDefinition (org.drools.workbench.models.datamodel.workitems.PortableWorkDefinition)48 Test (org.junit.Test)30 ActionWorkItemCol52 (org.drools.workbench.models.guided.dtable.shared.model.ActionWorkItemCol52)17 PortableStringParameterDefinition (org.drools.workbench.models.datamodel.workitems.PortableStringParameterDefinition)16 ActionExecuteWorkItem (org.drools.workbench.models.datamodel.rule.ActionExecuteWorkItem)14 PortableFloatParameterDefinition (org.drools.workbench.models.datamodel.workitems.PortableFloatParameterDefinition)14 RuleModel (org.drools.workbench.models.datamodel.rule.RuleModel)13 PortableBooleanParameterDefinition (org.drools.workbench.models.datamodel.workitems.PortableBooleanParameterDefinition)13 ArrayList (java.util.ArrayList)11 PortableIntegerParameterDefinition (org.drools.workbench.models.datamodel.workitems.PortableIntegerParameterDefinition)11 HashSet (java.util.HashSet)7 HashMap (java.util.HashMap)6 BaseSingleFieldConstraint (org.drools.workbench.models.datamodel.rule.BaseSingleFieldConstraint)6 CompositeFactPattern (org.drools.workbench.models.datamodel.rule.CompositeFactPattern)6 FactPattern (org.drools.workbench.models.datamodel.rule.FactPattern)6 FromAccumulateCompositeFactPattern (org.drools.workbench.models.datamodel.rule.FromAccumulateCompositeFactPattern)6 FromCollectCompositeFactPattern (org.drools.workbench.models.datamodel.rule.FromCollectCompositeFactPattern)6 FromCompositeFactPattern (org.drools.workbench.models.datamodel.rule.FromCompositeFactPattern)6 FromEntryPointFactPattern (org.drools.workbench.models.datamodel.rule.FromEntryPointFactPattern)6 SingleFieldConstraint (org.drools.workbench.models.datamodel.rule.SingleFieldConstraint)6