Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Examples on Condition Query and Condition Expression Businessmaps
#1
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?
Reply
#2
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.
Joe
TSolucio
Reply
#3
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?
Reply
#4
Yes. I want to integrate Hoa\Ruler: https://hoa-project.net/En/Literature/Hack/Ruler.html
Joe
TSolucio
Reply
#5
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
Joe
TSolucio
Reply
#6
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.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)