Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save tsurdilo/78508281682a18b20e0e3ba553385b46 to your computer and use it in GitHub Desktop.
Save tsurdilo/78508281682a18b20e0e3ba553385b46 to your computer and use it in GitHub Desktop.
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