Created
May 26, 2020 18:45
-
-
Save porcelli/6ec9ad0a5822886453c0ffecf65735ec to your computer and use it in GitHub Desktop.
Code for blog post: BPMN Extension for VSCode Now Available
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
$ curl -X POST http://kogito-persons.apps-crc.testing/persons \ | |
-H 'content-type: application/json' \ | |
-H 'accept: application/json' \ | |
-d '{"person": {"name":"John Quark", "age": 30}}' |
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
$ curl -X POST http://localhost:8080/persons \ | |
-H 'content-type: application/json' \ | |
-H 'accept: application/json' \ | |
-d '{"person": {"name":"John Quark", "age": 20}}' | |
{"id":"6906da37-4f09-436c-a1dc-8ec340e97664","person":{"adult":false,"age":20,"name":"John Quark"}} |
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
$ curl -X POST http://localhost:8080/persons \ | |
-H 'content-type: application/json' \ | |
-H 'accept: application/json' \ | |
-d '{"person": {"name":"John Quark", "age": 20}}' | |
{"id":"f5500cd5-9a1c-4ed8-9835-569a333a11c0","person":{"adult":true,"age":20,"name":"John Quark"}} |
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
$ kogito deploy kogito-persons https://github.com/porcelli/kogito-demo.git |
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
$ mvn io.quarkus:quarkus-maven-plugin:0.21.2:create \ | |
-DprojectGroupId=org.acme \ | |
-DprojectArtifactId=using-kogito \ | |
-Dextensions="kogito" |
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
$ oc logs -f bc/person-demo-builder -n kogito-dw-demo |
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.acme.kogito | |
import org.acme.kogito.model.Person; | |
rule "Is adult" ruleflow-group "person" | |
when | |
$person: Person(age > 21) | |
then | |
modify($person) { | |
setAdult(true) | |
}; | |
end |
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.acme.kogito.model; | |
public class Person { | |
private String name; | |
private int age; | |
private boolean adult; | |
public String getName() { | |
return name; | |
} | |
public void setName(String name) { | |
this.name = name; | |
} | |
public int getAge() { | |
return age; | |
} | |
public void setAge(int age) { | |
this.age = age; | |
} | |
public boolean isAdult() { | |
return adult; | |
} | |
public void setAdult(boolean adult) { | |
this.adult = adult; | |
} | |
@Override | |
public String toString() { | |
return "Person [name=" + name + ", age=" + age + ", adult=" + adult + "]"; | |
} | |
} |
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
$ ./mvnw clean compile quarkus:dev |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment