Search in sources :

Example 6 with ActionWorkItemCol52

use of org.drools.workbench.models.guided.dtable.shared.model.ActionWorkItemCol52 in project drools-wb by kiegroup.

the class PluginHandler method edit.

public void edit(final ActionCol52 column) {
    final DecisionTableColumnPlugin plugin;
    if (column instanceof ActionWorkItemSetFieldCol52 || column instanceof ActionWorkItemInsertFactCol52) {
        plugin = actionWorkItemSetFieldPlugin.get();
    } else if (column instanceof ActionInsertFactCol52 || column instanceof ActionSetFieldCol52) {
        plugin = actionSetFactPlugin.get();
    } else if (column instanceof ActionRetractFactCol52) {
        plugin = actionRetractFactPlugin.get();
    } else if (column instanceof ActionWorkItemCol52) {
        plugin = actionWorkItemPlugin.get();
    } else if (column instanceof BRLActionColumn) {
        plugin = brlActionColumnPlugin.get();
    } else {
        return;
    }
    plugin.setOriginalColumnConfig52(column);
    openWizard(plugin);
}
Also used : BRLActionColumn(org.drools.workbench.models.guided.dtable.shared.model.BRLActionColumn) ActionInsertFactCol52(org.drools.workbench.models.guided.dtable.shared.model.ActionInsertFactCol52) ActionWorkItemInsertFactCol52(org.drools.workbench.models.guided.dtable.shared.model.ActionWorkItemInsertFactCol52) ActionRetractFactCol52(org.drools.workbench.models.guided.dtable.shared.model.ActionRetractFactCol52) ActionWorkItemCol52(org.drools.workbench.models.guided.dtable.shared.model.ActionWorkItemCol52) ActionWorkItemSetFieldCol52(org.drools.workbench.models.guided.dtable.shared.model.ActionWorkItemSetFieldCol52) DecisionTableColumnPlugin(org.drools.workbench.screens.guided.dtable.client.wizard.column.plugins.commons.DecisionTableColumnPlugin) ActionSetFieldCol52(org.drools.workbench.models.guided.dtable.shared.model.ActionSetFieldCol52)

Example 7 with ActionWorkItemCol52

use of org.drools.workbench.models.guided.dtable.shared.model.ActionWorkItemCol52 in project drools-wb by kiegroup.

the class ActionWorkItemInsertFactColumnSynchronizer method append.

@Override
public void append(final ColumnMetaData metaData) throws VetoException {
    // Check operation is supported
    if (!handlesAppend(metaData)) {
        return;
    }
    final ActionWorkItemInsertFactCol52 column = (ActionWorkItemInsertFactCol52) metaData.getColumn();
    final String workItemName = column.getWorkItemName();
    model.getActionCols().stream().filter(c -> c instanceof ActionWorkItemCol52).map(c -> ((ActionWorkItemCol52) c)).filter(c -> c.getWorkItemDefinition().getName().equals(workItemName)).findFirst().ifPresent(c -> findLastIndexOfWorkItemColumn(c).ifPresent(index -> {
        model.getActionCols().add(index + 1, column);
        synchroniseAppendColumn(column);
    }));
}
Also used : ActionWorkItemCol52(org.drools.workbench.models.guided.dtable.shared.model.ActionWorkItemCol52) VetoException(org.drools.workbench.screens.guided.dtable.client.widget.table.model.synchronizers.ModelSynchronizer.VetoException) List(java.util.List) ActionWorkItemInsertFactCol52(org.drools.workbench.models.guided.dtable.shared.model.ActionWorkItemInsertFactCol52) Dependent(javax.enterprise.context.Dependent) BaseColumn(org.drools.workbench.models.guided.dtable.shared.model.BaseColumn) BaseColumnFieldDiff(org.drools.workbench.models.guided.dtable.shared.model.BaseColumnFieldDiff) Collections(java.util.Collections) BaseColumnFieldDiffImpl(org.drools.workbench.models.guided.dtable.shared.model.BaseColumnFieldDiffImpl) ActionWorkItemInsertFactCol52(org.drools.workbench.models.guided.dtable.shared.model.ActionWorkItemInsertFactCol52) ActionWorkItemCol52(org.drools.workbench.models.guided.dtable.shared.model.ActionWorkItemCol52)

Example 8 with ActionWorkItemCol52

use of org.drools.workbench.models.guided.dtable.shared.model.ActionWorkItemCol52 in project drools-wb by kiegroup.

the class ActionWorkItemSetFieldColumnSynchronizer method append.

@Override
public void append(final ColumnMetaData metaData) throws VetoException {
    // Check operation is supported
    if (!handlesAppend(metaData)) {
        return;
    }
    final ActionWorkItemSetFieldCol52 column = (ActionWorkItemSetFieldCol52) metaData.getColumn();
    final String workItemName = column.getWorkItemName();
    model.getActionCols().stream().filter(c -> c instanceof ActionWorkItemCol52).map(c -> ((ActionWorkItemCol52) c)).filter(c -> c.getWorkItemDefinition().getName().equals(workItemName)).findFirst().ifPresent(p -> findLastIndexOfWorkItemColumn(p).ifPresent(index -> {
        model.getActionCols().add(index + 1, column);
        synchroniseAppendColumn(column);
    }));
}
Also used : ActionWorkItemCol52(org.drools.workbench.models.guided.dtable.shared.model.ActionWorkItemCol52) VetoException(org.drools.workbench.screens.guided.dtable.client.widget.table.model.synchronizers.ModelSynchronizer.VetoException) List(java.util.List) Dependent(javax.enterprise.context.Dependent) BaseColumn(org.drools.workbench.models.guided.dtable.shared.model.BaseColumn) ActionWorkItemSetFieldCol52(org.drools.workbench.models.guided.dtable.shared.model.ActionWorkItemSetFieldCol52) BaseColumnFieldDiff(org.drools.workbench.models.guided.dtable.shared.model.BaseColumnFieldDiff) Collections(java.util.Collections) BaseColumnFieldDiffImpl(org.drools.workbench.models.guided.dtable.shared.model.BaseColumnFieldDiffImpl) ActionWorkItemCol52(org.drools.workbench.models.guided.dtable.shared.model.ActionWorkItemCol52) ActionWorkItemSetFieldCol52(org.drools.workbench.models.guided.dtable.shared.model.ActionWorkItemSetFieldCol52)

Example 9 with ActionWorkItemCol52

use of org.drools.workbench.models.guided.dtable.shared.model.ActionWorkItemCol52 in project drools-wb by kiegroup.

the class AuditLogEntryCellHelperTest method getSafeHtml_ActionWorkItemExecute_Complex.

@Test
public void getSafeHtml_ActionWorkItemExecute_Complex() {
    ActionWorkItemCol52 originalColumn = new ActionWorkItemCol52();
    originalColumn.setHeader("action1");
    originalColumn.setHideColumn(false);
    ActionWorkItemCol52 newColumn = new ActionWorkItemCol52();
    newColumn.setHeader("action2");
    newColumn.setHideColumn(true);
    PortableStringParameterDefinition param1 = new PortableStringParameterDefinition();
    param1.setName("param1");
    param1.setValue("value1");
    PortableStringParameterDefinition param2 = new PortableStringParameterDefinition();
    param2.setName("param2");
    param2.setValue("value2");
    PortableWorkDefinition def1 = new PortableWorkDefinition();
    def1.setName("def1name");
    def1.addParameter(param1);
    def1.addParameter(param2);
    PortableStringParameterDefinition param3 = new PortableStringParameterDefinition();
    param3.setName("param3");
    param3.setValue("value3");
    PortableStringParameterDefinition param4 = new PortableStringParameterDefinition();
    param4.setName("param1");
    param4.setValue("value1");
    PortableStringParameterDefinition param5 = new PortableStringParameterDefinition();
    param5.setName("param5");
    param5.setBinding("binding5");
    PortableStringParameterDefinition param6 = new PortableStringParameterDefinition();
    param6.setName("param2");
    param6.setValue("value6");
    PortableWorkDefinition def2 = new PortableWorkDefinition();
    def2.setName("def2name");
    def2.addParameter(param3);
    def2.addParameter(param4);
    def2.addParameter(param5);
    def2.addParameter(param6);
    originalColumn.setWorkItemDefinition(def1);
    newColumn.setWorkItemDefinition(def2);
    List<BaseColumnFieldDiff> diffs = originalColumn.diff(newColumn);
    SafeHtml result = helper.getSafeHtml(new UpdateColumnAuditLogEntry("mock user", originalColumn, newColumn, diffs));
    assertEquals(getActionHeaderRepre(newColumn.getHeader()) + getDiffRepre(diffs), result.asString());
}
Also used : PortableStringParameterDefinition(org.drools.workbench.models.datamodel.workitems.PortableStringParameterDefinition) ActionWorkItemCol52(org.drools.workbench.models.guided.dtable.shared.model.ActionWorkItemCol52) UpdateColumnAuditLogEntry(org.drools.workbench.models.guided.dtable.shared.auditlog.UpdateColumnAuditLogEntry) SafeHtml(com.google.gwt.safehtml.shared.SafeHtml) PortableWorkDefinition(org.drools.workbench.models.datamodel.workitems.PortableWorkDefinition) BaseColumnFieldDiff(org.drools.workbench.models.guided.dtable.shared.model.BaseColumnFieldDiff) Test(org.junit.Test)

Example 10 with ActionWorkItemCol52

use of org.drools.workbench.models.guided.dtable.shared.model.ActionWorkItemCol52 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)

Aggregations

ActionWorkItemCol52 (org.drools.workbench.models.guided.dtable.shared.model.ActionWorkItemCol52)38 Test (org.junit.Test)25 PortableWorkDefinition (org.drools.workbench.models.datamodel.workitems.PortableWorkDefinition)17 ArrayList (java.util.ArrayList)8 BaseColumn (org.drools.workbench.models.guided.dtable.shared.model.BaseColumn)8 PortableFloatParameterDefinition (org.drools.workbench.models.datamodel.workitems.PortableFloatParameterDefinition)7 PortableStringParameterDefinition (org.drools.workbench.models.datamodel.workitems.PortableStringParameterDefinition)7 ActionCol52 (org.drools.workbench.models.guided.dtable.shared.model.ActionCol52)7 DTCellValue52 (org.drools.workbench.models.guided.dtable.shared.model.DTCellValue52)7 ActionExecuteWorkItem (org.drools.workbench.models.datamodel.rule.ActionExecuteWorkItem)6 RuleModel (org.drools.workbench.models.datamodel.rule.RuleModel)6 PortableBooleanParameterDefinition (org.drools.workbench.models.datamodel.workitems.PortableBooleanParameterDefinition)6 GuidedDTTemplateDataProvider (org.drools.workbench.models.guided.dtable.backend.util.GuidedDTTemplateDataProvider)6 TemplateDataProvider (org.drools.workbench.models.guided.dtable.backend.util.TemplateDataProvider)6 BaseColumnFieldDiff (org.drools.workbench.models.guided.dtable.shared.model.BaseColumnFieldDiff)6 DescriptionCol52 (org.drools.workbench.models.guided.dtable.shared.model.DescriptionCol52)6 RowNumberCol52 (org.drools.workbench.models.guided.dtable.shared.model.RowNumberCol52)6 ActionWorkItemInsertFactCol52 (org.drools.workbench.models.guided.dtable.shared.model.ActionWorkItemInsertFactCol52)5 ActionWorkItemSetFieldCol52 (org.drools.workbench.models.guided.dtable.shared.model.ActionWorkItemSetFieldCol52)5 BooleanUiColumn (org.drools.workbench.screens.guided.dtable.client.widget.table.columns.BooleanUiColumn)5