Closed (fixed)
Project:
Rules
Version:
7.x-2.x-dev
Component:
Rules Core
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
9 May 2011 at 16:43 UTC
Updated:
26 May 2012 at 19:53 UTC
Jump to comment: Most recent file
Let's support some basic math
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | rules_calc_ajax.patch | 762 bytes | fago |
Comments
Comment #1
fagoSome thoughts:
* we should add some data processor that can apply some basic offsets to numbers like we have it for dates. We could even support different operations here, but we are limited to apply the operation with a fixed value, e.g. "* 2".
* add a "calculate data value" action that takes two input parameters and provides the result as a new variable. This action is useful even with two dynamic arguments then.
The action should work with numbers and/or durations. Maybe we also want to support moving dates by a given duration?
Given we need the action anyway, I guess it suffices to support just a basic offset for numbers as data processor.
Comment #2
fagoI've implemented the action + the data processor + committed both.
However, the action configuration form is not optimal yet as it needs to be reloaded if once selects a date as first input. Using the #ajax system with the data selector does not seem to work properly though. For now, I've activated an "Reload form" button, so the action can be configured.
Patch which enables the #ajax-refresh attached. I leave the issue open for fixing the form to work with #ajax reloads.
Comment #3
sepgil commentedI've opened a new issue for the reloading form problem: Dynamicly reload parameters depending data selector
Comment #4
fagook, so let's set this issue to fixed then.
Comment #6
mitchell commentedUpdated component.