Examples on Condition Query and Condition Expression Businessmaps - Printable Version +- CoreBOSBB (https://discussions.corebos.org) +-- Forum: Development (https://discussions.corebos.org/forumdisplay.php?fid=18) +--- Forum: coreBOS Development (https://discussions.corebos.org/forumdisplay.php?fid=4) +--- Thread: Examples on Condition Query and Condition Expression Businessmaps (/showthread.php?tid=642) |
Examples on Condition Query and Condition Expression Businessmaps - Guido1982 - 05-01-2017 I don't fully understand how to use/implement these two maptypes. Is there any documentation other than in the wiki? Or maybe some example use cases? RE: Examples on Condition Query and Condition Expression Businessmaps - joebordes - 05-01-2017 AFAIK there is nothing more than what you can find in the wiki. There is a test script which I use to test the implementation where you can see an example of a call and play with some of your own maps: https://github.com/tsolucio/corebos/blob/master/modules/cbMap/testMap.php#L77 which would be called like: http://your_server/your_corebos/index.php?module=cbMap&action=testMap&record={cbMap record ID} The goal of the Condition Query and Condition Expression maps are to give the user control over conditions in your code. In other words, they are developer's maps. Imagine that you need to get a discount for an account. Instead of hard coding that discount/logic you can use one of these maps to get the value. That way, when you need to change the logic in obtaining the value you can simply change the mapping functionality. Your code will stay the same as it will simply call the map and get the value, how it is actually calculated stays in the map and can change when needed. Another example, suppose that you can set an invoice due date to 30 days for all accounts that have more than 10 paid invoices. Instead of hard coding that "10" in your custom validations you launch the query in a map, so when direction comes and changes the condition to 5 or "10 in the last two months" you simply change the map, not your code. Keep asking. RE: Examples on Condition Query and Condition Expression Businessmaps - Guido1982 - 05-01-2017 So, if I understand correctly I could create a module that gets some information from somewhere through a Business Map, and when I want to modify that without modifying my module's code, I could modify the Business Map in stead? Sounds cool! One thing I'd really like is conditional logic in field mapping, wasn't something like this underway? RE: Examples on Condition Query and Condition Expression Businessmaps - joebordes - 05-01-2017 Yes. I want to integrate Hoa\Ruler: https://hoa-project.net/En/Literature/Hack/Ruler.html RE: Examples on Condition Query and Condition Expression Businessmaps - joebordes - 07-11-2017 Constructing on top of Condition Query and Condition Expression I added a rule evaluation class: http://blog.corebos.org:8080/en/blog/corebosrules http://corebos.org/documentation/doku.php?id=en:devel:corebos_rules HTH RE: Examples on Condition Query and Condition Expression Businessmaps - Guido1982 - 07-25-2017 Thanks! I read the blog post and doc page. I have a vague concept of what this could do (seems powerfull). So when I have a use-case that I think will match I'll get back on this. |