Hi,
I have some trouble using the FEEL-Scala plugin correctly. I do not know neither I have configured the server correctly nor I am using type definitions correctly. Maybe you can help.
What I have done so far:
- I am using the latest CamundaBPM for the Tomcat server
- I downloaded the latest feel-scala-plugin (Release 1.6.2 · camunda/feel-scala · GitHub)
- I copied the plugin jar to the lib folder of my tomcat
- I editet the bpm-platform.xml file and added
<plugins>
<plugin>
<class>org.camunda.feel.CamundaFeelEnginePlugin</class>
</plugin>
</plugins>
- I started the server and no warnings came up. Plugin seems to be avtivated.
To make a quick test I made this simple decision, deployed it and evaluated it by this short java program.
diagram_1.dmn (1.7 KB)
DmnEngine dmnEngine = DmnEngineConfiguration.createDefaultDmnEngineConfiguration().buildEngine();
DefaultDmnEngineConfiguration config = (DefaultDmnEngineConfiguration) dmnEngine.getConfiguration();
config.setFeelEngineFactory(new CamundaFeelEngineFactory());
config.setDefaultInputExpressionExpressionLanguage("feel-scala-unary-tests");
config.setDefaultInputExpressionExpressionLanguage("feel-scala");
config.setDefaultLiteralExpressionLanguage("feel-scala");
config.setDefaultOutputEntryExpressionLanguage("feel-scala");
dmnEngine = config.buildEngine();
// read the DMN XML file as input stream
InputStream inputStream = null;
try {
inputStream = new FileInputStream("./src/main/resources/diagram_1.dmn"); //decisionId
} catch (FileNotFoundException e) {
e.printStackTrace();
}
DmnDecision decision = dmnEngine.parseDecision("decisionId", inputStream);
DmnDecisionTableResult result = dmnEngine.evaluateDecisionTable(decision, variables);
List<Map<String, Object>> listOfResultMaps = result.getResultList();
int i = 1;
for(Map<String, Object> map : listOfResultMaps) {
System.out.println(i + ". Ergebnis");
for(String key : map.keySet()) {
System.out.println(key + " = " + map.get(key));
}
}
Request1:
Everything works fine so far, i.e. the decision gets evaluated as desired, except for a warning, which came up when I deployed the decision. It says, that values of the unsupported type “datetime” will not transform into another type. Trying the types datetime
, datetimeduration
, yearMonthDuration
, time
, feel-date-time
result in the engine giving me the same warning. I have not tried feel-local-date-time
, feel-time
, feel-date
or feel-local-time
because I expected the same warning.
My question: What datatyps are the correct ones to use, when feel-scala-plugin should be applied?
Request2:
When I create a small BPMN process including the decision I mentioned before and as can be seen in the following picture, I deploy it and start it, the engines brings up this warning:
28-Mar-2019 14:31:22.326 SCHWERWIEGEND [http-nio-8080-exec-10] org.camunda.commons.logging.BaseLogger.logError ENGINE-16004 Exception while closing command context: Uninitialized object exists on backward branch 152
Exception Details:
Location:
scala/util/matching/Regex.unapplySeq(Ljava/lang/Object;)Lscala/Option; @207: goto
Reason:
Error exists in the bytecode
Bytecode:
0000000: 2bc1 00cc 9900 e92b c000 cc4e 2ab6 0054
0000010: 2db6 005a 3a04 2a19 04b6 005e 9900 cabb
0000020: 0060 59b2 0065 b200 6a04 3606 c700 0501
0000030: bf15 0619 04b6 0070 b600 74b6 0078 1904
0000040: ba01 0a00 00b2 0093 b600 973a 093a 0859
0000050: c700 0501 bf3a 0719 09b2 0093 b600 9ba6
0000060: 0078 1907 b200 a0a6 0009 b200 a0a7 0073
0000070: bb00 a259 1907 b600 a83a 0e19 0419 0eb8
0000080: 0108 b200 a0b7 00ac 3a0a 190a 3a0b 1907
0000090: b600 afc0 00a4 3a0c 190c b200 a0a5 0035
00000a0: bb00 a259 190c b600 a83a 0e19 0419 0eb8
00000b0: 0108 b200 a0b7 00ac 3a0d 190b 190d b600
00000c0: b319 0d3a 0b19 0cb6 00af c000 a43a 0ca7
00000d0: ffc9 190a a700 0c19 0719 0819 09b8 00b9
00000e0: b700 bca7 0006 b200 524d a700 212b c100
00000f0: 2299 0016 2bc0 0022 3a05 2a19 05b6 00ef
0000100: b601 024d a700 07b2 0052 4d2c b0
Stackmap Table:
full_frame(@49,{Object[#2],Object[#4],Top,Object[#204],Object[#108],Top,Integer},{Uninitialized[#31],Uninitialized[#31],Object[#98]})
full_frame(@85,{Object[#2],Object[#4],Top,Object[#204],Object[#108],Top,Integer,Top,Object[#206],Object[#208]},{Uninitialized[#31],Uninitialized[#31],Object[#164]})
full_frame(@112,{Object[#2],Object[#4],Top,Object[#204],Object[#108],Top,Integer,Object[#164],Object[#206],Object[#208]},{Uninitialized[#31],Uninitialized[#31]})
full_frame(@152,{Object[#2],Object[#4],Top,Object[#204],Object[#108],Top,Integer,Object[#164],Object[#206],Object[#208],Object[#162],Object[#162],Object[#164],Top,Object[#4]},{Uninitialized[#31],Uninitialized[#31]})
full_frame(@210,{Object[#2],Object[#4],Top,Object[#204],Object[#108],Top,Integer,Object[#164],Object[#206],Object[#208],Object[#162],Object[#162],Object[#164],Top,Object[#4]},{Uninitialized[#31],Uninitialized[#31]})
full_frame(@215,{Object[#2],Object[#4],Top,Object[#204],Object[#108],Top,Integer,Object[#164],Object[#206],Object[#208]},{Uninitialized[#31],Uninitialized[#31]})
full_frame(@224,{Object[#2],Object[#4],Top,Object[#204],Object[#108],Top,Integer,Object[#164],Object[#206],Object[#208]},{Uninitialized[#31],Uninitialized[#31],Object[#4]})
full_frame(@230,{Object[#2],Object[#4],Top,Object[#204],Object[#108]},{})
same_locals_1_stack_item_frame(@233,Object[#210])
chop_frame(@237,3)
same_frame(@263)
append_frame(@267,Object[#210])
...
FullStackTrace.txt (46.1 KB)
Has anybody a clue, what went wrong? Querying the decision from my Java class worked well. Is there a problem in the plugin configuration or anywhere else? Do I have to set a default expression language for input- and outputEntries? I tried to add some properties to the server configuration but it does not seem to do the trick.
<plugin>
<class>org.camunda.feel.CamundaFeelEnginePlugin</class>
<properties>
<property name="defaultOutputEntryExpressionLanguage">feel-scala</property>
<property name="defaultInputEntryExpressionLanguage">feel-scala</property>
</properties>
</plugin>
Regards
Patrick