Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Examples on Condition Query and Condition Expression Businessmaps
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?
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:

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.
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?
Yes. I want to integrate Hoa\Ruler:
Constructing on top of Condition Query and Condition Expression I added a rule evaluation class:

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.

Forum Jump:

Users browsing this thread: 1 Guest(s)