More of a general showcase of how to use the embedded rule and process engines.
|
3 gadi atpakaļ | |
---|---|---|
src | 3 gadi atpakaļ | |
.gitignore | 3 gadi atpakaļ | |
COPYING | 3 gadi atpakaļ | |
README.md | 3 gadi atpakaļ | |
pom.xml | 3 gadi atpakaļ |
A bunch of examples of using the Kie API to create an embedded rule or process engine and either evaluate rules or run various processes.
By package:
rules
SimpleMatch
simple
simple
FactIntegritySingle
, FactIntegrityMultiple
integrity
integrity
AssertAndQueryFacts
awards
facts
AgendaGroupsWrongOrderLog
, AgendaGroupsRightOrderLog
agendaWrong
, agendaRight
agenda.wrong
, agenda.right
processes
ProcessWithFacts
ruleflow
ruleflow
ruleflow.RulesRulesRules
ProcessWithParams
ruleflow
ruleflow
ruleflow.RulesRulesRules
ProcessWithParamsOnly
ruleflowParams
ruleflow_params
ruleflow.RulesRulesRules
(different package!)ProcessWithListParams
ruleflowParams
ruleflow_params
ruleflow.RulesWithListParams
List<Customer>
) do not match the rules. Facts must be presented
individually for the matching patterns to be able to see them. The
process was just modified to change parameter types and adjust I/O
mappings for BR tasks. No other logic changes.ProcessWithListSubProcess
ruleflowParams
ruleflow_params
ruleflow.RulesWithListSubProc
List
as the driver. The sub-processes then iterate over the
lists, and a single script task in each of the two is used to insert the
facts into the working memory. Since there is the possibility that
multiple customers have been passed in for processing, the
congratulations task must also iterate over the list of awards and decide
whom to congratulate based on each award's state. Uses the kcontext
implicit global variable in script tasks, and is hence non-portable.use_rest
All of the classes in this package use the serviceTasks
knowledge base,
which only makes the service_tasks
Kie package available to the engines.
UseSimpleJavaBeanService
servicetasks.JavaBeanServiceTask
beans.GenerateCustomer
UseRestEasyManualClient
servicetasks.JavaRestClientServiceTask
ws_client.CustomerServiceClient
Request
/Response
approach. Note how the service task does not
change, in principle, it is the implementation that makes the difference.UseRestEasyProxyClient
servicetasks.JavaRestProxyServiceTask
ws_client.CustomerServiceProxy
shared-data-model
project. Much easier and safer.UseRestServiceTask
servicetasks.BpmnRestTask
taskName="Rest"
attribute as the CodeReady tooling does not have a
definition of a REST custom task, and regularly chokes on it, or else,
without the taskName
attribute, the engine complains that the
custom task has no type and dies.Just contains a single class, UseRemoteKieArtifact
, which loads a RHPAM
project with GAV coordinates of
net.p0f.samples.rhpam-fuse-integration:pam-simple-process:1.0.0-SNAPSHOT
using a remote KieContainer
, and then just for the sake of the example,
also creates a KieScanner
which has the ability to reload that container
and update it to latest version in order for new sessions to be able to use the
updated artifacts.