Comments (7)
@mankoni You can raise a DMN issue and propose the functions here https://issues.omg.org/issues/create-new-issue
The issue will be addressed by the DMN RTF force.
from tck.
Hi, there are no set functions like you mention, however there is e.g. list contains function which you can use in combination with a for loop to construct such custom function(s). Or you can call an external Java function. You can find all list functions in the "10.3.4.4 List functions" section of the specification (https://www.omg.org/spec/DMN/1.3/PDF).
from tck.
Hi baldimir
Thx for the quick response. I was able to achieve this with a for loop as you stated - looping through both lists. I faced 2 issues with this approach:
- When I find a match, I could not use "remove" list function as this requires a "match" to get the offset; Even then , once removed the offset of remaining elements change.
- the IF then ELSE syntax requires ELSE as mandatory so I had to replace elements that matched with a unique value (say 9999999). I then sorted the resulting array where I get 999999 at the end of the list. These elements need to be removed. Since they are at the end of the list, I counted the # of 999999 and used the sublist function to truncate the list (as opposed to remove function that requires offsets)
This is a workaround but I am not happy with this approach. In the absence of a cleaner approach I will go with this for now.
EXAMPLE: List 1[1,2,3,5,6] ; List 2[3,5]
List1 - List2 = [1,2,6]
Steps:
Find List1 , List2 matching elements and replace with 999999(or some high value) and sort. Output>> [1,2,6,99999,99999]
Count the # of 999999 using for loop using context variable. Output>>2
Use sublist to truncate List 1. sublist(List1,1,count(List1)-2). Output>>[1,2,6]
from tck.
@opatrascoiu , Will do. Thx
from tck.
@mankoni I played with this a bit and found out you can do something like that with filtering:
list[some filter]
, e.g. list1[list contains(list2, item)]
from tck.
from tck.
Thanks to Bruce and Baldimir. Excellent solutions for my need. I will close this issue
from tck.
Related Issues (20)
- Review/restore the workflow for publishing compliance results HOT 1
- Investigate the possibility to test compliance of a Python engine HOT 7
- Possible incompatibility issue HOT 5
- Clarify FEEL `null` handling in `FilterExpression` HOT 4
- Clarify FEEL `null` handling in `PathExpression` HOT 1
- Clarify mixed type workings of `+` operator HOT 3
- Clarify `null` handling in `FunctionInvocation` HOT 6
- Cover comparisons
- Create transitive import test cases based on snippets in DMN15-58 HOT 2
- Doubtful typing on overloaded built-in function in test HOT 2
- Report does not work under windows
- The test cases table breaks up around Compliance-Level-3
- New PRs ... but deleting them. The PRs have dragged in CL/LF differences HOT 2
- Patches to test cases HOT 4
- Confused about decision service encapsulatedDecisions - ambiguous - is ch11 example correct? HOT 5
- Task list for DMN 1.6
- Optional fn params vs null values HOT 4
- Question to test case `decision_015` in `0084-feel-for-loops.dmn` HOT 1
- Quesion to test case `nested009` in `1146-feel-context-put-function.dmn` HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tck.