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);
}
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);
}));
}
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);
}));
}
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());
}
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;
}
Aggregations