Created
May 6, 2020 03:53
-
-
Save tsurdilo/78508281682a18b20e0e3ba553385b46 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.kie.kogito.serverless | |
import com.fasterxml.jackson.databind.JsonNode | |
import com.fasterxml.jackson.databind.node.ObjectNode | |
import java.lang.Integer | |
rule "Approve Application" | |
ruleflow-group "newapplicant" | |
no-loop | |
when | |
$w : JsonNode() | |
eval( Integer.parseInt($w.get("salary").asText()) > 3000) | |
then | |
( (ObjectNode) $w ).put("decision", "Approved"); | |
end | |
rule "Deny Application" | |
ruleflow-group "newapplicant" | |
no-loop | |
when | |
$w : JsonNode() | |
eval( Integer.parseInt($w.get("salary").asText()) < 3000) | |
then | |
( (ObjectNode) $w ).put("decision", "Denied"); | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment