#102: Added general NOT feature to conditions

This commit is contained in:
frikky
2020-07-23 16:02:29 +02:00
parent 10ac88d30b
commit d161b1ee99
3 changed files with 25 additions and 13 deletions
+11 -1
View File
@@ -710,7 +710,17 @@ class AppBase:
continue
#print(destinationvalue)
if not run_validation(sourcevalue, condition["condition"]["value"], destinationvalue):
# NEGATE
validation = run_validation(sourcevalue, condition["condition"]["value"], destinationvalue)
# Configuration = negated because of WorkflowAppActionParam..
try:
if condition["condition"]["configuration"]:
validation = not validation
except KeyError:
pass
if not validation:
self.logger.info("Failed condition check for %s %s %s." % (sourcevalue, condition["condition"]["value"], destinationvalue))
return False, "Failed condition: %s %s %s" % (sourcevalue, condition["condition"]["value"], destinationvalue)
+1
View File
@@ -94,6 +94,7 @@ type AuthenticationUsage struct {
}
// An app inside Shuffle
// Source string `json:"source" datastore:"soure" yaml:"source"` - downloadlocation
type WorkflowApp struct {
Name string `json:"name" yaml:"name" required:true datastore:"name"`
IsValid bool `json:"is_valid" yaml:"is_valid" required:true datastore:"is_valid"`