Created
May 1, 2020 15:34
-
-
Save tsurdilo/7adcf9f0eb6bb5a36ca22acf3d1278d7 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
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(); | |
unit_traveller.set((org.acme.travel.Traveller) (kcontext.getVariable("traveller"))); | |
} | |
org.acme.travel.Traveller traveller = (org.acme.travel.Traveller) (kcontext.getVariable("traveller")); | |
{ | |
org.kie.kogito.rules.SingletonStore unit_traveller = unit.getTraveller(); | |
unit_traveller.subscribe(org.kie.kogito.rules.DataObserver.ofUpdatable(o -> kcontext.setVariable("traveller", o))); | |
} | |
return unit; | |
} | |
public org.kie.kogito.rules.RuleUnit<org.acme.travel.TravellerValidationService> unit() { | |
return app.ruleUnits().create(org.acme.travel.TravellerValidationService.class); | |
} | |
public void unbind(org.kie.api.runtime.process.ProcessContext kcontext, org.acme.travel.TravellerValidationService unit) { | |
org.acme.travel.Traveller traveller = (org.acme.travel.Traveller) (kcontext.getVariable("traveller")); | |
{ | |
org.kie.kogito.rules.SingletonStore unit_traveller = unit.getTraveller(); | |
unit_traveller.subscribe(org.kie.kogito.rules.DataObserver.ofUpdatable(o -> kcontext.setVariable("traveller", o))); | |
} | |
} | |
}); | |
ruleSetNode4.metaData("UniqueId", "_60FA6326-76DC-4DB2-AB06-DB8AC8EE8DC8"); | |
ruleSetNode4.metaData("elementname", "Process Traveler"); | |
ruleSetNode4.metaData("x", 244); | |
ruleSetNode4.metaData("width", 154); | |
ruleSetNode4.metaData("y", 71); | |
ruleSetNode4.metaData("customAsync", "true"); | |
ruleSetNode4.metaData("height", 102); | |
ruleSetNode4.done(); | |
<bpmn2:businessRuleTask id="_60FA6326-76DC-4DB2-AB06-DB8AC8EE8DC8" drools:ruleFlowGroup="unit:org.acme.travel.TravellerValidationService" name="Process Traveler" implementation="http://www.jboss.org/drools/rule"> | |
<bpmn2:extensionElements> | |
<drools:metaData name="elementname"> | |
<drools:metaValue>Process Traveler</drools:metaValue> | |
</drools:metaData> | |
<drools:metaData name="customAsync"> | |
<drools:metaValue>true</drools:metaValue> | |
</drools:metaData> | |
</bpmn2:extensionElements> | |
<bpmn2:incoming>_D15CD483-D31D-42F8-A93A-AAAF44292D84</bpmn2:incoming> | |
<bpmn2:outgoing>_96F8E118-C58C-4369-89DC-2C881614FF73</bpmn2:outgoing> | |
<bpmn2:ioSpecification id="_DqJU0EzDEDizovwZ6iAEfA"> | |
<bpmn2:dataInput id="_60FA6326-76DC-4DB2-AB06-DB8AC8EE8DC8_travellerInputX" drools:dtype="org.acme.travel.Traveller" itemSubjectRef="__60FA6326-76DC-4DB2-AB06-DB8AC8EE8DC8_travellerInputXItem" name="traveller"/> | |
<bpmn2:dataOutput id="_60FA6326-76DC-4DB2-AB06-DB8AC8EE8DC8_travellerOutputX" drools:dtype="org.acme.travel.Traveller" itemSubjectRef="__60FA6326-76DC-4DB2-AB06-DB8AC8EE8DC8_travellerOutputXItem" name="traveller"/> | |
<bpmn2:inputSet id="_DqLxEEzDEDizovwZ6iAEfA"> | |
<bpmn2:dataInputRefs>_60FA6326-76DC-4DB2-AB06-DB8AC8EE8DC8_travellerInputX</bpmn2:dataInputRefs> | |
</bpmn2:inputSet> | |
<bpmn2:outputSet id="_DqLxEUzDEDizovwZ6iAEfA"> | |
<bpmn2:dataOutputRefs>_60FA6326-76DC-4DB2-AB06-DB8AC8EE8DC8_travellerOutputX</bpmn2:dataOutputRefs> | |
</bpmn2:outputSet> | |
</bpmn2:ioSpecification> | |
<bpmn2:dataInputAssociation id="_DqLxEkzDEDizovwZ6iAEfA"> | |
<bpmn2:sourceRef>traveller</bpmn2:sourceRef> | |
<bpmn2:targetRef>_60FA6326-76DC-4DB2-AB06-DB8AC8EE8DC8_travellerInputX</bpmn2:targetRef> | |
</bpmn2:dataInputAssociation> | |
<bpmn2:dataOutputAssociation id="_DqMYIEzDEDizovwZ6iAEfA"> | |
<bpmn2:sourceRef>_60FA6326-76DC-4DB2-AB06-DB8AC8EE8DC8_travellerOutputX</bpmn2:sourceRef> | |
<bpmn2:targetRef>traveller</bpmn2:targetRef> | |
</bpmn2:dataOutputAssociation> | |
</bpmn2:businessRuleTask> |
org.jbpm.ruleflow.core.factory.RuleSetNodeFactory ruleSetNode3 = factory.ruleSetNode(3);
ruleSetNode3.name("Evaluate Person");
ruleSetNode3.inMapping("persons", "person");
ruleSetNode3.ruleUnit("org.acme.travels.PersonValidationService", new org.jbpm.workflow.core.node.RuleUnitFactory<org.acme.travels.PersonValidationService>() {
public org.acme.travels.PersonValidationService bind(org.kie.api.runtime.process.ProcessContext kcontext) {
org.acme.travels.PersonValidationService unit = new org.acme.travels.PersonValidationService();
{
org.kie.kogito.rules.DataStore unit_persons = unit.getPersons();
unit_persons.add((org.acme.travels.Person) (kcontext.getVariable("person")));
}
org.acme.travels.Person person = (org.acme.travels.Person) (kcontext.getVariable("person"));
{
org.kie.kogito.rules.DataStore unit_persons = unit.getPersons();
unit_persons.subscribe(org.kie.kogito.rules.DataObserver.ofUpdatable(o -> kcontext.setVariable("person", o)));
}
return unit;
}
public org.kie.kogito.rules.RuleUnit<org.acme.travels.PersonValidationService> unit() {
return app.ruleUnits().create(org.acme.travels.PersonValidationService.class);
}
public void unbind(org.kie.api.runtime.process.ProcessContext kcontext, org.acme.travels.PersonValidationService unit) {
}
});
ruleSetNode3.metaData("UniqueId", "_7B8CC121-6F99-464A-93F8-9EAC4BE4601A");
ruleSetNode3.metaData("elementname", "Evaluate Person");
ruleSetNode3.metaData("x", 456);
ruleSetNode3.metaData("width", 154);
ruleSetNode3.metaData("y", 112);
ruleSetNode3.metaData("height", 102);
ruleSetNode3.done();
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
org.jbpm.ruleflow.core.factory.RuleSetNodeFactory ruleSetNode3 = factory.ruleSetNode(3);
ruleSetNode3.name("Evaluate Person");
ruleSetNode3.inMapping("persons", "person");
ruleSetNode3.ruleUnit("org.acme.travels.PersonValidationService", new org.jbpm.workflow.core.node.RuleUnitFactory<org.acme.travels.PersonValidationService>() {
<bpmn2:businessRuleTask id="_7B8CC121-6F99-464A-93F8-9EAC4BE4601A" drools:ruleFlowGroup="unit:org.acme.travels.PersonValidationService" name="Evaluate Person" implementation="http://www.jboss.org/drools/rule">
bpmn2:extensionElements
<drools:metaData name="elementname">
drools:metaValueEvaluate Person</drools:metaValue>
</drools:metaData>
</bpmn2:extensionElements>
bpmn2:incoming_41D07816-A956-491C-9787-5B8C0B8C4F58</bpmn2:incoming>
bpmn2:outgoing_29B77FA9-3C5F-4EC3-9F37-5D74C182F3C0</bpmn2:outgoing>
<bpmn2:ioSpecification id="_ugd6QE8QEDiTNMCLyjv0ag">
<bpmn2:dataInput id="_7B8CC121-6F99-464A-93F8-9EAC4BE4601A_personsInputX" drools:dtype="org.amce.travels.Person" itemSubjectRef="__7B8CC121-6F99-464A-93F8-9EAC4BE4601A_personsInputXItem" name="persons"/>
<bpmn2:inputSet id="_ugd6QU8QEDiTNMCLyjv0ag">
bpmn2:dataInputRefs_7B8CC121-6F99-464A-93F8-9EAC4BE4601A_personsInputX</bpmn2:dataInputRefs>
</bpmn2:inputSet>
</bpmn2:ioSpecification>
<bpmn2:dataInputAssociation id="_ugehUE8QEDiTNMCLyjv0ag">
bpmn2:sourceRefperson</bpmn2:sourceRef>
bpmn2:targetRef_7B8CC121-6F99-464A-93F8-9EAC4BE4601A_personsInputX</bpmn2:targetRef>
</bpmn2:dataInputAssociation>
</bpmn2:businessRuleTask>