Exception while evaluating Camunda DMN decision - camunda-modeler

I am trying to parse a sample decision table, but getting below exception
org.camunda.bpm.dmn.feel.impl.FeelException: FEEL/SCALA-01008 Error while evaluating expression: failed to evaluate expression ‘“Fall”’: no variable found for name ‘cellInput’
I have created dmn file using Camunda Modeler Version 4.12.0 and below is java code to parse the decision.
VariableMap variables = Variables
.putValue(“season”, “Spring”);
DmnEngine dmnEngine = DmnEngineConfiguration.createDefaultDmnEngineConfiguration().buildEngine();
InputStream inputStream = DishDecider.class.getResourceAsStream("/dishTest.dmn");
DmnModelInstance dmnModelInstance = Dmn.readModelFromStream(inputStream);
List decisions = dmnEngine.parseDecisions(dmnModelInstance);
DmnDecision decision = decisions.get(0);
DmnDecisionTableResult result = dmnEngine.evaluateDecisionTable(decision, variables);
String desiredDish = result.getSingleResult().getSingleEntry();
System.out.println("Dish Decision:\n\tI would recommend to serve: " + desiredDish);
Below is dmn file created with Camunda modeler 4.12.0
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="https://www.omg.org/spec/DMN/20191111/MODEL/" xmlns:dmndi="https://www.omg.org/spec/DMN/20191111/DMNDI/" xmlns:dc="http://www.omg.org/spec/DMN/20180521/DC/" xmlns:camunda="http://camunda.org/schema/1.0/dmn" id="decision" name="Dish" namespace="http://camunda.org/schema/1.0/dmn" exporter="Camunda Modeler" exporterVersion="4.12.0">
<decision id="Decision_0iitlac" name="Dish">
<decisionTable id="DecisionTable_0gwyugh" hitPolicy="ANY">
<input id="Input_1" label="Season" camunda:inputVariable="season">
<inputExpression id="InputExpression_1" typeRef="string">
<text>season</text>
</inputExpression>
</input>
<output id="Output_1" label="Dish" name="desiredDish" typeRef="string" />
<rule id="DecisionRule_0oq0hav">
<description>-</description>
<inputEntry id="UnaryTests_0m9w26w">
<text>"Fall"</text>
</inputEntry>
<outputEntry id="LiteralExpression_0ii151o">
<text>"Spareribs"</text>
</outputEntry>
</rule>
<rule id="DecisionRule_1atwuts">
<description>-</description>
<inputEntry id="UnaryTests_1bnxqqw">
<text>"Winter"</text>
</inputEntry>
<outputEntry id="LiteralExpression_1bzzfsr">
<text>"RoastBeer"</text>
</outputEntry>
</rule>
<rule id="DecisionRule_0kf4y0a">
<inputEntry id="UnaryTests_09pkbsv">
<text>"Spring"</text>
</inputEntry>
<outputEntry id="LiteralExpression_0fx9hii">
<text>"Dry Aged steak"</text>
</outputEntry>
</rule>
<rule id="DecisionRule_020pynb">
<description>Less Effort</description>
<inputEntry id="UnaryTests_10ydtir">
<text>"Fall","Winter","Spring"</text>
</inputEntry>
<outputEntry id="LiteralExpression_0byu0h6">
<text>"Stew"</text>
</outputEntry>
</rule>
<rule id="DecisionRule_19jjhib">
<description>Hey why not</description>
<inputEntry id="UnaryTests_03eg1qd">
<text>"Summer"</text>
</inputEntry>
<outputEntry id="LiteralExpression_0cx6p63">
<text>"Light Sald"</text>
</outputEntry>
</rule>
<rule id="DecisionRule_1cnr8kg">
<inputEntry id="UnaryTests_12w0ceb">
<text></text>
</inputEntry>
<outputEntry id="LiteralExpression_1g1nomo">
<text></text>
</outputEntry>
</rule>
</decisionTable>
</decision>
<dmndi:DMNDI>
<dmndi:DMNDiagram>
<dmndi:DMNShape dmnElementRef="Decision_0iitlac">
<dc:Bounds height="80" width="180" x="160" y="100" />
</dmndi:DMNShape>
</dmndi:DMNDiagram>
</dmndi:DMNDI>
</definitions>
Any help is appreciated.

Is there a reason you are writing java code to parse the DMN table yourself? The Camunda engine will parse and evaluate the table for you as part of running the process.
That being said, It does not appear that your Java code is complete as I cannot see where you are feeding in any variables. I assume that you should be providing an input variable cellInput to be evaluated.
dg

In the Season Column you are changing the default for the field 'Input Variable' from cellInput to season. Remove season from the Input variable field and make sure a value for the data season is passed in.

Related

WSO2 : Transforming response xml

I would like to turn this xml response into something more easily readable.
<?xml version="1.0" encoding="ISO-8859-1"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Header xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"/>
<soap:Body>
<executeResponse xmlns="urn:GCE">
<BusinessViewServiceexecuteOut xmlns="http://www.generix.fr/technicalframework/businesscomponent/applicationmodule/common" xmlns:ns2="http://www.generixgroup.com/processus/configuration/scheduler" xmlns:ns3="http://www.generix.fr/technicalframework/business/service/common">
<xmlpres><?xml version = '1.0' encoding = 'UTF-8'?> <VueTable type="View" name="Table" habctr="true" total_business_row="2" nbline="400" confNbline="400" numpage="1" nbpage="1">
<JTblView name="JTblView" type="ViewObject" maxfetchsize="999" maxfetchsizeexceeded="false">
<JTblViewRow current="true" type="ViewRow" index="1" business_row_index="1">
<Cletbl precision="6" type="VARCHAR" pk="true">
<business_data>N</business_data>
</Cletbl>
<Codtbl precision="6" type="VARCHAR" pk="true">
<business_data>001</business_data>
</Codtbl>
<Lib1 precision="30" type="VARCHAR">
<business_data>Non</business_data>
</Lib1>
<Lib2 precision="30" type="VARCHAR">
<business_data/>
</Lib2>
<Lir precision="10" type="VARCHAR">
<business_data>Non</business_data>
</Lir>
</JTblViewRow>
<JTblViewRow type="ViewRow" index="2" business_row_index="2">
<Cletbl precision="6" type="VARCHAR" pk="true">
<business_data>O</business_data>
</Cletbl>
<Codtbl precision="6" type="VARCHAR" pk="true">
<business_data>001</business_data>
</Codtbl>
<Lib1 precision="30" type="VARCHAR">
<business_data>Oui</business_data>
</Lib1>
<Lib2 precision="30" type="VARCHAR">
<business_data/>
</Lib2>
<Lir precision="10" type="VARCHAR">
<business_data>Oui</business_data>
</Lir>
</JTblViewRow>
</JTblView>
</VueTable></xmlpres>
</BusinessViewServiceexecuteOut>
</executeResponse>
</soap:Body></soap:Envelope>
At least if I could extract what's in the value of "xmlpres", the better I could do:
<table><row><code></code><libelle></libelle/></row></table>
To then turn it into a json response but I can't see ... I just get all the output or in json stream but with everything , which is not usable.
Create an out-mediation sequence with the following content and attach it to the respective API and try out the scenario. This is to extract the xmlpres content and send that as the response to the client
<?xml version="1.0" encoding="UTF-8"?>
<sequence xmlns="http://ws.apache.org/ns/synapse" name="out-sequence">
<!-- extract the xmlpres content and store as OM element -->
<property name="XMLBody"
expression="$body//soap:Body//generic:xmlpres"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:gce="urn:GCE"
xmlns:generic="http://www.generix.fr/technicalframework/businesscomponent/applicationmodule/common" type="OM" />
<!-- pass the extracted property as response body -->
<enrich>
<source type="property" property="XMLBody" />
<target type="body" />
</enrich>
</sequence>
Hope this helps you to extract and send the response accordingly.

XQuery error: Filtering with variable returning empty result

I try to run the following XQuery:
let $d := doc("ferry.xml")
let $x := $d/ferry/trips/trip[#depart='08:00' and start='Stockholm']/captain[#crew]
return $d/ferry/crews/crew[#crewID=$x]/name
And get an empty result.
I would like to get the value in <name> where <crew crewID="JI"> (=Jill).
I can see that $x includes <captain crew="JI"/> and when I run
return $d/ferry/crews/crew[#crewID='JI']/name
I get the expected result.
How can I make the return function read the variable correctly? Here is the XML file:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ferry>
<ships>
<ship shipID="SKHM">
<name>Skeppsholm</name>
</ship>
<ship shipID="PERL">
<name>Pearl</name>
<cars>40</cars>
</ship>
<ship shipID="REVG">
<name>Revenge></name>
<length>50</length>
</ship>
</ships>
<crews>
<crew crewID="JO">
<name>Jack</name>
<job>service</job>
<job>deckhand</job>
</crew>
<crew crewID="JI">
<name>Jill</name>
<job>captain</job>
<job>firstmate</job>
</crew>
<crew crewID="HA">
<name>Harry</name>
<job>deckhand</job>
</crew>
</crews>
<trips>
<trip date="20171020" depart="08:00">
<start>Stockholm</start>
<end>Vaxholm</end>
<captain crew="JI" />
<service crew="JO" />
</trip>
<trip date="20171130" depart="10:00">
<start>Nacka</start>
<end>Gustavberg</end>
<captain crew="JI" />
<deckhand crew="HA" />
<service crew="JA" />
</trip>
</trips>
</ferry>
Try changing
let $x := $d/ferry/trips/trip[#depart='08:00' and start='Stockholm']/captain[#crew]
to
let $x := $d/ferry/trips/trip[#depart='08:00' and start='Stockholm']/captain/#crew
You need $x to be just the value of the crew attribute; currently it returns the whole element <captain crew="JI"/>.

Dynamically populate version from version.sbt

I'm trying to take the version from version.sbt and and populate it to logback.xml's log appender's applicationVersion field.
version.sbt
version in ThisBuild := "0.4.63"
logback.xml
<configuration debug="true" scan="true" scanPeriod="60 seconds">
<appender name="ADP-MESSAGING" class="com.agoda.adp.messaging.logging.appenders.LogbackAppender">
<applicationName>MyApp</applicationName>
<applicationAssemblyName>myapp</applicationAssemblyName>
<applicationVersion>0.4.61</applicationVersion>
<!-- <applicationVersion>${application.version}</applicationVersion> -->
<apiKey>s234W##$WFW$#$#</apiKey>
<getCallerData>false</getCallerData>
</appender>
....
<root level="WARN">
<appender-ref ref="ADP-MESSAGING" />
<appender-ref ref="STDOUT" />
</root>
</configuration>
I tried by adding ${application.version}, ${version} but no success.
How can I do this?
Please share your thoughts.
Thanks
The values interpolated in a logback.xml file are simply Java system properties. All you have to do is add a value to your Java commandline defining the value you want:
// NOTE: This will only work when running through sbt. You'll have to
// append the same value to your startup scripts when running elsewhere.
javaOptions += "-Dapplication.version=" + version.value
With this flag, you should be able to interpolate the version in your XML file:
<applicationVersion>${application.version}</applicationVersion>
You can add logback PropertyDefiner implementation:
package org.mypackage
import ch.qos.logback.core.PropertyDefinerBase
class VersionPropertyDefiner extends PropertyDefinerBase {
override def getPropertyValue: String = BuildInfo.version
}
You will get autogenerated (managed) scala code BuildInfo.version if you use BuildInfoPlugin in your project build settings.
Then you can define and use variable in your logback.xml configuration:
<configuration debug="true" scan="true" scanPeriod="60 seconds">
<define name="appVersion" class="org.mypackage.VersionPropertyDefiner"/>
<appender name="ADP-MESSAGING" class="com.agoda.adp.messaging.logging.appenders.LogbackAppender">
<applicationName>MyApp</applicationName>
<applicationAssemblyName>myapp</applicationAssemblyName>
<applicationVersion>${appVersion}</applicationVersion>
<apiKey>s234W##$WFW$#$#</apiKey>
<getCallerData>false</getCallerData>
</appender>
....
<root level="WARN">
<appender-ref ref="ADP-MESSAGING" />
<appender-ref ref="STDOUT" />
</root>
</configuration>

How to config bigbluebutton to work with external Red5 server

From high level architecture overview for bigbluebutton http://docs.bigbluebutton.org/overview/architecture.html I understand that red5 server communicates with client using rtmp or by tunning rtmp via nginx. And then red5 server communicate with FreeSwitch using redis (with fsesl-akka). It mean we are able to desploy red5 in separately server. The result should be 3 servers:
Server for nginx/tomcat7 to run client, bbb-web
Server for Red5 + redis which handle rtmp for module videoconf/sharing/call/audio
Server for Freeswitch
Currently, I am able to config module to use rtmp from separately Red5 server by changing client/conf/config.xml
<config>
<localeversion suppressWarning="false">0.9.0</localeversion>
<version>VERSION</version>
<help url="http://10.0.121.16/help.html"/>
<javaTest url="http://10.0.121.16/testjava.html"/>
<porttest host="10.0.121.16" application="video/portTest" timeout="10000"/>
<bwMon server="10.0.121.16" application="video/bwTest"/>
<application uri="rtmp://10.0.121.16/bigbluebutton" host="http://10.0.121.16/bigbluebutton/api/enter"/>
<language userSelectionEnabled="true" />
<skinning enabled="true" url="http://10.0.121.16/client/branding/css/BBBDefault.css.swf" />
<shortcutKeys showButton="true" />
<browserVersions chrome="CHROME_VERSION" firefox="FIREFOX_VERSION" flash="FLASH_VERSION" java="1.7.0_51" />
<layout showLogButton="false" defaultLayout="bbb.layout.name.defaultlayout"
showToolbar="true" showFooter="true" showMeetingName="true" showHelpButton="true"
showLogoutWindow="true" showLayoutTools="true" confirmLogout="true"
showRecordingNotification="true"/>
<meeting muteOnStart="false" />
<logging enabled="true" target="trace" level="info" format="{dateUTC} {time} :: {name} :: [{logLevel}] {message}" uri="http://10.0.121.16"/>
<lock disableCamForLockedUsers="false" disableMicForLockedUsers="false" disablePrivateChatForLockedUsers="false"
disablePublicChatForLockedUsers="false" lockLayoutForLockedUsers="false" lockOnJoin="true" lockOnJoinConfigurable="false"/>
<modules>
<module name="ChatModule" url="http://10.0.121.16/client/ChatModule.swf?v=VERSION"
uri="rtmp://10.0.121.16/bigbluebutton"
dependsOn="UsersModule"
privateEnabled="true"
fontSize="12"
position="top-right"
baseTabIndex="701"
colorPickerIsVisible="false"
maxMessageLength="1024"
/>
<module name="UsersModule" url="http://10.0.121.16/client/UsersModule.swf?v=VERSION"
uri="rtmp://10.0.121.16/bigbluebutton"
allowKickUser="true"
enableEmojiStatus="true"
enableSettingsButton="true"
baseTabIndex="301"
/>
<module name="DeskShareModule"
url="http://10.0.121.16/client/DeskShareModule.swf?v=VERSION"
uri="rtmp://10.0.121.16/deskShare"
publishURI="10.0.121.16"
useTLS="false"
showButton="true"
autoStart="false"
autoFullScreen="false"
baseTabIndex="201"
/>
<module name="PhoneModule" url="http://10.0.121.16/client/PhoneModule.swf?v=VERSION"
uri="rtmp://10.0.121.16/sip"
autoJoin="true"
listenOnlyMode="true"
presenterShareOnly="false"
skipCheck="false"
showButton="true"
enabledEchoCancel="true"
useWebRTCIfAvailable="true"
showPhoneOption="false"
echoTestApp="9196"
dependsOn="UsersModule"
/>
<module name="VideoconfModule" url="http://10.0.121.16/client/VideoconfModule.swf?v=VERSION"
uri="rtmp://10.0.121.16/video"
dependson = "UsersModule"
baseTabIndex="401"
presenterShareOnly = "false"
controlsForPresenter = "false"
autoStart = "false"
skipCamSettingsCheck="false"
showButton = "true"
showCloseButton = "true"
publishWindowVisible = "true"
viewerWindowMaxed = "false"
viewerWindowLocation = "top"
smoothVideo="false"
applyConvolutionFilter="false"
convolutionFilter="-1, 0, -1, 0, 6, 0, -1, 0, -1"
filterBias="0"
filterDivisor="4"
displayAvatar = "false"
focusTalking = "false"
glowColor = "0x4A931D"
glowBlurSize = "30.0"
priorityRatio = "0.67"
/>
<module name="WhiteboardModule" url="http://10.0.121.16/client/WhiteboardModule.swf?v=VERSION"
uri="rtmp://10.0.121.16/bigbluebutton"
dependsOn="PresentModule"
baseTabIndex="601"
whiteboardAccess="presenter"
keepToolbarVisible="false"
/>
<module name="PollingModule" url="http://10.0.121.16/client/PollingModule.swf?v=VERSION"
uri="rtmp://10.0.121.16/bigbluebutton"
dependsOn="PresentModule"
/>
<module name="PresentModule" url="http://10.0.121.16/client/PresentModule.swf?v=VERSION"
uri="rtmp://10.0.121.16/bigbluebutton"
host="http://10.0.121.16"
showPresentWindow="true"
showWindowControls="true"
openExternalFileUploadDialog="false"
dependsOn="UsersModule"
baseTabIndex="501"
maxFileSize="30"
/>
<module name="LayoutModule" url="http://10.0.121.16/client/LayoutModule.swf?v=VERSION"
uri="rtmp://10.0.121.16/bigbluebutton"
layoutConfig="http://10.0.121.16/client/conf/layout.xml"
enableEdit="false"
/>
</modules>
</config>
Where 10.0.121.14 - run Red5 + redis. 10.0.121.16 run nginx + tomcat7. Any document/help/suggestion from expert for solve this issue?
Seperate Red5 servers can distribute video and deskshare modules, just need to get the archiving scripts to pull the .flv files from stream directory when processing. I would leave the basic red5 on bbb server to handle the rest of messaging with local redis store.
If you want to not have red5 on server all together, then you would need to enable the red5 server to have access to connect to redis. Be careful. downt think and password is set, so you dont want to expose this on public interface without using correct iptable rules.
regards,
Stephen
hostbbb.com

fusioncharts: Line graph is giving errors

Iam able to draw graphs like "Column2D, Column3D, Bar2D, Bar3D, Funnel etc, but Iam unable to draw graphs of "Line" and "MsLine". Following is my javascript code :
jQuery('#myChartContainer').insertFusionCharts({
swfPath: base_url+'resource/js/Charts/',
width : '400',
height: '500',
type: "MSLine",
chartRightMargin: '20',
data: "<graph caption='Monthly Sales Summary'
subcaption='For the year 2004'
xAxisName='Month'
yAxisMinValue='15000'
yAxisName='Sales'
numberPrefix='$'
showNames='1'
showValues='0'
rotateNames='0'
showColumnShadow='1'
animation='1'
showAlternateHGridColor='1'
AlternateHGridColor='ff5904'
divLineColor='ff5904'
divLineAlpha='20'
alternateHGridAlpha='5'
canvasBorderColor='666666'
baseFontColor='666666'>
<set name='Jan' value='17400' hoverText='January'/>
<set name='Feb' value='19800' hoverText='February'/>
<set name='Mar' value='21800' hoverText='March'/>
<set name='Apr' value='23800' hoverText='April'/>
<set name='May' value='29600' hoverText='May'/>
<set name='Jun' value='27600' hoverText='June'/>
<set name='Jul' value='31800' hoverText='July'/>
<set name='Aug' value='39700' hoverText='August'/>
<set name='Sep' value='37800' hoverText='September'/>
<set name='Oct' value='21900' hoverText='October'/>
<set name='Nov' value='32900' hoverText='November' />
<set name='Dec' value='39800' hoverText='December' />
</graph>",
dataFormat: "XMLData",
wMode: "transparent"
});
When I use, Line/MSLine graphs, I get following error in FIREBIG :
"uncaught exception: Chart Type Not Found!"
But when I check swf files on server, I can see LINE and MSLINE swfs, along with other graph swfs like COLUMNS2S, COLUMN3D, FUNNEL etc.
Can some one guide me where and what Iam doing wrong and how it can be rectified.
Thanks in advance
Have you been able to successfuly plot any charts?
I'm also not convinced your XML is valid. Please see the FusionCharts Support Forum for the relevant XSDs. I haven't created FusionCharts usign JavaScript before but the following is valid xml:
<chart>
<categories>
<category label='Jan'>
<category label='Feb'>
<category label='Mar'>
<category label='Apr'>
<category label='May'>
<category label='Jun'>
<category label='Jul'>
<category label='Aug'>
<category label='Sep'>
<category label='Oct'>
<category label='Nov'>
<category label='Dec'>
</categories>
<dataset>
<set value='17400' hoverText='January'/>
<set value='19800' hoverText='February'/>
<set value='21800' hoverText='March'/>
<set value='23800' hoverText='April'/>
<set value='29600' hoverText='May'/>
<set value='27600' hoverText='June'/>
<set value='31800' hoverText='July'/>
<set value='39700' hoverText='August'/>
<set value='37800' hoverText='September'/>
<set value='21900' hoverText='October'/>
<set value='32900' hoverText='November' />
<set value='39800' hoverText='December' />
</dataset>
</chart>
Please try once using the name line2d and msline2d.
Here is the list of acceptable chart types:
area2d
bar2d
bubble
candlestick
column2d
column3d
donut2d
donut3d
doughnut2d
doughnut3d
dragarea
dragcolumn2d
dragline
dragnode
drawingpad
errorbar2D
exportcomponent
funnel
gantt
horizontalbullet
inversearea2d
inversecolumn2d
inverseline2d
kagi
line2d
logcolumn2d
logline2d
msarea2d
msbar2d
msbar3d
mscolumn2d
mscolumn3d
mscolumn3dline
mscolumn3dlinedy
mscombi2d
mscombi3d
mscombidy2d
msline2d
msspline2d
mssplinearea2d
msstackedcolumn2d
msstackedcolumn2dlinedy
multiaxisline
multilevelpie
pie2d
pie3d
pyramid
radar
realtimeangular
realtimearea
realtimebulb
realtimecolumn
realtimecylinder
realtimehorizontalled
realtimehorizontallinear
realtimeline
realtimestackedarea
realtimestackedcolumn
realtimethermometer
realtimeverticalled
scatter
scrollarea2d
scrollcolumn2d
scrollcombi2d
scrollcombidy2d
scrollline2d
scrollstackedcolumn2d
selectscatter
sparkcolumn
sparkline
sparkwinloss
spline2d
splinearea2d
ssgrid
stackedarea2d
stackedbar2d
stackedbar3d
stackedcolumn2d
stackedcolumn3d
stackedcolumn3dlinedy
verticalbullet
waterfall

Resources