Re: need help with rule
Re: need help with rule
- Subject: Re: need help with rule
- From: Jesse Tayler <email@hidden>
- Date: Tue, 31 Jul 2012 10:55:07 -0400
hmm...well, if you want to trigger rules based on a significant key, you can write rules
session.currentProject.id = '12' -> propertyKey = "this"
vs.
session.currentProject.id = '14' -> propertyKey = "that"
or something.
which as long as session.currentProject is a significant key, the rules will recalculate each time (so changing the current project works as expected) when you ask to fire a rule with that significant key at runtime.
I typically make session.user a significant key and use it in just this way.
but it sounds like you want to set the value of a local variable inside your D2W Query page?
in this case, you'll likely need your own component or page such that you can code and hold the variables in question -
this is also something I do with D2W is make page level components that layout or handle business logic, often times I program the business logic right into rules and write smart D2W pages and components that understand my significant keys and business logic.
maybe someone knows more or I'm confused - so, not sure if that helps….
On Jul 31, 2012, at 10:40 AM, Theodore Petrosky <email@hidden> wrote:
>
> I want to set the value of an object in a query page from a variable that lives in the session.
>
> session().currentProject();
>
> Ted
>
>
> --- On Tue, 7/31/12, Jesse Tayler <email@hidden> wrote:
>
>> From: Jesse Tayler <email@hidden>
>> Subject: Re: need help with rule
>> To: "Theodore Petrosky" <email@hidden>
>> Cc: email@hidden
>> Date: Tuesday, July 31, 2012, 10:30 AM
>>
>> what's the rule you are trying to write here Ted?
>>
>> you are setting your page configuration based on a literal
>> string AND propertyKey = literal?
>>
>> are you trying to set a variable or are you trying to read
>> some state and setup a page configuration?
>>
>>
>> On Jul 31, 2012, at 6:09 AM, Theodore Petrosky <email@hidden>
>> wrote:
>>
>>> my model has:
>>>
>>> Project toOne ProjectCategory.
>>>
>>> I have a key 'currentProjectCategory' in my
>> ERXThreadStorage.
>>>
>>> When I access my query page, I want to set the
>> ProjectCategory with this value.
>>>
>>> lhs pageConfiguration = 'QueryProject' and propertyKey
>> = 'projectCategory'
>>>
>>> what is the assignment and rhs
>>>
>>> I don't understand the rhs value.
>>>
>>> Help
>>>
>>> Ted
>>> _______________________________________________
>>> Do not post admin requests to the list. They will be
>> ignored.
>>> Webobjects-dev mailing list (email@hidden)
>>> Help/Unsubscribe/Update your Subscription:
>>>
>>> This email sent to email@hidden
>>
>>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden