Skip to content

Commit

Permalink
[KNOWAGE-2252] Docs for isValid func in dataset's script
Browse files Browse the repository at this point in the history
  • Loading branch information
Marco Libanori committed Sep 22, 2020
1 parent e9a610f commit 08d1f64
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
4 changes: 3 additions & 1 deletion knowage/src/main/resources/predefinedJavascriptScript.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,13 @@ function getInClauseForNullableValues(colName, parName){
}
}

parameters.isValid = function(key) {
function isValid(key) {
return key != null
&& parameters.get(key) != null
&& parameters.get(key) != ''
&& parameters.get(key) != "''"
&& parameters.get(key) != "null"
&& parameters.get(key) != "%";
}

parameters.isValid = isValid;
7 changes: 7 additions & 0 deletions knowage/src/main/webapp/themes/sbi_default/html/dsrules.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,13 @@
, ")" )</i>
<hr />
</li>
<li><b>isValid('attribute_name') </b>: Returns true if the value
of the attribute is not null or empty or equals to "''"" or equals
to "null" or equals to "%" <br />
<i><b>Example:</b>
isValid('${multi_value_attribute}')</i>
<hr />
</li>
</ul>
</div>
</body>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,13 @@ function getInClauseForNullableValues(colName, parName){
}
}

parameters.isValid = function(key) {
function isValid(key) {
return key != null
&& parameters.get(key) != null
&& parameters.get(key) != ''
&& parameters.get(key) != "''"
&& parameters.get(key) != "null"
&& parameters.get(key) != "%";
}

parameters.isValid = isValid;

0 comments on commit 08d1f64

Please sign in to comment.