Skip to content
Snippets Groups Projects
Commit bb09aa65 authored by Jonas Blatt's avatar Jonas Blatt :ant:
Browse files

Perform action "add Rule" for missing rule verifier

parent 804a1d66
No related branches found
No related tags found
No related merge requests found
...@@ -66,8 +66,8 @@ public class MissingRuleVerifier extends AbstractVerifier { ...@@ -66,8 +66,8 @@ public class MissingRuleVerifier extends AbstractVerifier {
Action.Builder fixActionBuilder = Action.Builder fixActionBuilder =
Action.getBuilder().withActionScope(ActionScope.RULE).withActionType(ActionType.CREATE); Action.getBuilder().withActionScope(ActionScope.RULE).withActionType(ActionType.CREATE);
for (VDmnInputValue v : missingRule.getDmnInputValues()) { for (VDmnInputValue v : missingRule.getDmnInputValues()) {
fixActionBuilder.addValue("inputColumnId", v.getDmnInputColumn().getInputId().getValue()); fixActionBuilder.addValue(
fixActionBuilder.addValue("value", v.getBoundary().getParsedText()); v.getDmnInputColumn().getInputId().getValue(), v.getBoundary().getParsedText());
} }
vreFactory vreFactory
.addVerificationFix(VerificationFix.SHOW_DECISION) .addVerificationFix(VerificationFix.SHOW_DECISION)
......
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
* @property {number} id * @property {number} id
* @property {string} actionScope * @property {string} actionScope
* @property {string} actionType SHOW, UPDATE, INSERT, DELETE * @property {string} actionType SHOW, UPDATE, INSERT, DELETE
* @property {Object.<string, number>} actionValues * @property {Object.<string, string>} actionValues
*/ */
/** /**
......
...@@ -16,8 +16,9 @@ function performVerificationFix(verificationEntry, fix, id) { ...@@ -16,8 +16,9 @@ function performVerificationFix(verificationEntry, fix, id) {
break; break;
case 'UPDATE': case 'UPDATE':
// break; // break;
case 'INSERT': case 'CREATE':
// break; performVerificationFixCREATE(verificationEntry, fix.actions[i]);
break;
case 'DELETE': case 'DELETE':
// break; // break;
default: default:
...@@ -135,3 +136,46 @@ function fixSHOW_DECISION_TABLE(verificationEntry, fixAction) { ...@@ -135,3 +136,46 @@ function fixSHOW_DECISION_TABLE(verificationEntry, fixAction) {
function fixSHOW_DECISION(verificationEntry, fixAction) { function fixSHOW_DECISION(verificationEntry, fixAction) {
highlightDecision(verificationEntry.elements); highlightDecision(verificationEntry.elements);
} }
/**
*
* @param {VerificationEntry} verificationEntry
* @param {Action} fixAction
*/
function performVerificationFixCREATE(verificationEntry, fixAction) {
switch (fixAction.actionScope) {
case 'RULE':
createRule(verificationEntry, fixAction);
break;
case 'INPUT_ENTRY':
case 'OUTPUT_ENTRY':
case 'INPUT_DATA':
case 'INPUT_COLUMN':
case 'OUTPUT_COLUMN':
case 'DECISION_TABLE':
case 'DECISION':
default:
alert("ACTION undefined: " + fix.actions[i].actionType + ' -> '
+ fix.actions[i].actionScope);
}
}
/**
*
* @param {VerificationEntry} verificationEntry
* @param {Action} fixAction
*/
function createRule(verificationEntry, fixAction) {
$('#tab-dec-'
+ verificationEntry.elements[0].identifier['decisionId']).click();
$('.tjs-table tfoot .add-rule-add').click();
let $lastRow = $('.tjs-table tbody tr:last');
for (const [key, value] of Object.entries(fixAction.actionValues)) {
let $cell = $lastRow.find('[data-col-id=' + key + ']').find(
'.content-editable');
$cell.empty();
$cell.append(`${value}`);
$cell.append(`<br>`);
$cell.trigger('input')
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment