blob: 535ff4a3a98a6dc79c31b9a7a2894d12e9840ebb [file] [log] [blame]
////
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
////
:documentationPath: /plugins/actions/
:language: en_US
:page-alternativeEditUrl: https://github.com/apache/incubator-hop/edit/master/plugins/actions/simpleeval/src/main/doc/simpleeval.adoc
= Simple Evaluation
== Description
The Simple Evaluation action can be used to evaluate contents of a variable or a field in the result stream.
Connect two actions with the output of the Simple Evaluation. The green connection will be called on success, the red one on failure.
== Options
[width="90%", options="header"]
|===
|Option|Description
|Workflow action name|The name of the workflow action.
|Evaluate|Evaluation type: field or variable.
|Field name|The field to evaluate
|Type|Data type.
|Success condition a|
* If value equal to
* If value different from
* If value contains
* If value not contains
* If value starts with
* If value not starts with
* If value ends with
* If value not ends with
* If value valid regex
* If value in list
* If value not in list
|Value|The value to compare.
|===
== Tips
**Evaluating a variable**
[width="90%", options="header"]
|===
|Field|Value|Explanation
|Source: Evaluate|Variable|Select this to evaluate a variable set before
|Source: Variable name|e. g. ${VAR1}|Enter the variable name using the usual syntax
|Source: Type|String, Number etc.|The type of your variable
|Success on: Success when variable set||When this option is selected, the true path is followed when the variable is set.
Note: The workflow action checks if the variable is defined, so an empty or null value is also true. When testing this within Hop you need to delete the line with the variable in the variables section of the Execute a workflow window. And remember: Once this variable is set, the variable keeps existing, even when deleting it from the list.
|Success On: Success condition|Equal/Non equal/etc.|Select the condition to be met for a successful result
|Success On: Value||Value to compare the variable to
|===
**Evaluating a field**
[width="90%", options="header"]
|===
|Field|Value|Explanation
|Source: Evaluate|Field from previous result|Select this to evaluate a field value (generated by a pipeline using Copy rows to result)
|Source: Field name||Enter the field name from the result row
|Source: Type|String, Number etc.|The type of your field
|Success On: Success condition|Equal/Non equal/etc.|Select the condition to be met for a successful result
|Success On: Value||Value to compare the field to
|===