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 |
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
--- | |
id: applicantworkflow | |
name: Applicant Workflow | |
version: '1.0' | |
events: | |
- name: NewApplicantEvent | |
source: applicants | |
type: kafka | |
- name: ApplicantDecisionEvent | |
source: decisions |
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
<!-- needed for react integration --> | |
<plugin> | |
<groupId>com.github.eirslett</groupId> | |
<artifactId>frontend-maven-plugin</artifactId> | |
<version>1.6</version> | |
<configuration> | |
<workingDirectory>reactapp</workingDirectory> | |
<installDirectory>target</installDirectory> | |
</configuration> | |
<executions> |
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
public RuleSetNode ruleUnitNode(long id, String name, Function function, NodeContainer nodeContainer) { | |
RuleSetNode ruleSetNode = new RuleSetNode(); | |
ruleSetNode.setId(id); | |
ruleSetNode.setName(name); | |
//ruleSetNode.setLanguage(RuleSetNode.DRL_LANG); | |
if (ServerlessWorkflowUtils.resolveFunctionMetadata(function, RF_GROUP, workflowAppContext).length() > 0) { | |
ruleSetNode.setRuleType(RuleSetNode.RuleType.of(ServerlessWorkflowUtils.resolveFunctionMetadata(function, RF_GROUP, workflowAppContext), | |
RuleSetNode.DRL_LANG)); | |
} else { |
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
org.jbpm.ruleflow.core.factory.RuleSetNodeFactory ruleSetNode4 = factory.ruleSetNode(4); | |
ruleSetNode4.name("Process Traveler"); | |
ruleSetNode4.inMapping("traveller", "traveller"); | |
ruleSetNode4.outMapping("traveller", "traveller"); | |
ruleSetNode4.ruleUnit("org.acme.travel.TravellerValidationService", new org.jbpm.workflow.core.node.RuleUnitFactory<org.acme.travel.TravellerValidationService>() { | |
public org.acme.travel.TravellerValidationService bind(org.kie.api.runtime.process.ProcessContext kcontext) { | |
org.acme.travel.TravellerValidationService unit = new org.acme.travel.TravellerValidationService(); | |
{ | |
org.kie.kogito.rules.SingletonStore unit_traveller = unit.getTraveller(); |
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
{ | |
"id": "decisionworkflow", | |
"name": "Decision Workflow", | |
"version": "1.0", | |
"functions": [ | |
{ | |
"name": "doapproval", | |
"type": "decision", | |
"metadata": { | |
"actorid": "workflow", |
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
swgeneratorcontext |
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
apiVersion: app.kiegroup.org/v1alpha1 | |
kind: KogitoApp | |
metadata: | |
name: kogito-travel-agency | |
spec: | |
enableEvents: true | |
enablePersistence: true | |
build: | |
gitSource: | |
contextDir: kogito-travel-agency |
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
{ | |
"id": "jsonservicecall", | |
"version": "1.0", | |
"name": "Service Call Workflow", | |
"description": "JSON based service call workflow", | |
"functions": [ | |
{ | |
"name": "countryInfoFunction", | |
"type": "service" | |
}, |
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
***************** runtime updates -- application properties: | |
org.kogito.serverless.examples.CountriesService/mp-rest/url=https://restcountries.eu/rest | |
org.kogito.serverless.examples.CountriesService/mp-rest/scope=javax.inject.Singleton | |
# serverless workflow properties | |
kogito.sw.functions.countryInfoFunction.interface=org.kogito.serverless.examples.CountriesResource | |
kogito.sw.functions.countryInfoFunction.operation=jsonName | |
kogito.sw.functions.classifySmallMediumFunction.interface=org.kogito.serverless.examples.CountriesClassifierResource | |
kogito.sw.functions.classifySmallMediumFunction.operation=classifySmallMedium | |
kogito.sw.functions.classifyLargeFunction.interface=org.kogito.serverless.examples.CountriesClassifierResource |