Ajay,
Rule constraints can only reason on data in the working memory. In
general there are two strategies for handling your problem then:
1) The variable you want to access (in this case the request) is also
inserted in the working memory. That way you could write something like:
$r: Request( )
Response( tag == $r.id )
Note that this would not work if you insert all requests simultaneously
into the same session (as any combination of request / response in the
session would trigger this process instance to continue, not only the
request related to this process instance. So that means you would
execute each process instance in a separate session.
2) You can also bind to the variables of your process instance by also
inserting your process instances in your session (for example using an
(on-entry/on-exit/normal) action in your process or by inserting it
through the api after starting it), so the rule constraint also has
access to that information. Special logic makes sure that, if you are
evaluating a rule constraint inside the context of a specific process
instance, the "processInstance" variable is always bound to the current
process instance.
processInstance: WorkflowProcessInstance()
$r: Request( ) from processInstance.getVariable("request")
Response( tag == $r.id )
We're still working on making that more user-friendly (advanced
execution mode will automatically insert/update the process instances
whenever necessary so you don't have to manage that yourself), so
suggestions in that area are welcome.
Thx,
Kris
Quoting Ajay.Gautam(a)rbs.com:
I am trying to figure out how to specify the constraint for Event
wait.
The rules flow diagram attached would be launched for each incoming
"request". The request is set in a process scope variable (reqIn).
Each request has a *tag* associated with it.
The event wait in question is waiting for a response event with the
same tag value.
How would I create a constraint rule to match this?
I guess the bigger question here is, how do I access the process
scope request variable in the constraint?
Something like:
RFQResponse (tag == reqIn.tag)
PS: When I try this, I get an error: "Unable to create restriction
'[QualifiedIndentifierRestr: == reqIn.tag ]' for field 'tag' in the
rule 'RuleFlow-Milestone-com.rbs.gbm.pm.RFQ-WorkFlow-21' : [Rule
name='RuleFlow-Milestone-com.rbs.gbm.pm.RFQ-WorkFlow-21']"
Any help / pointers would be highly appreciated.
Thanks
Ajay Gautam
*****Please note that my email address may have changed. For all
future correspondence, please use this address*****
********************************************************************This
message (including any attachments) is confidential and/or
privileged. It is to be used by the intended recipients only. If
you have received it by mistake please notify the sender by return
e-mail and delete this message from your system. Any unauthorized
use or dissemination of this message in whole or in part is
strictly prohibited. Please note that e-mails are inherently
insecure and susceptible to change. The Royal Bank of Scotland
Group, plc ("RBS") and its US subsidiaries, and affiliates and
subsidiary undertakings, including but not limited to, RBS plc New
York and Connecticut Branches, RBS Securities Inc., ABN AMRO Bank
N.V. New York and Chicago Branches and, ABN AMRO Incorporated,
Citizens Financial Group, Inc. and RBS Citizens, N.A., shall not be
liable for the improper or incomplete transmission of the
information contained in this communication or Attachment nor for
any delay in its receipt or damage to your system. RBS does not
guarantee that the integrity of this communication has been
maintained nor that this communication is free of viruses,
interceptions or interference. RBS and its subsidiaries and
affiliates do not guarantee the accuracy of any email or
attachment, that an email will be received or that RBS or its
affiliates and subsidiaries will respond to an email.
RBS makes no representations that any information contained in this
message (including any attachments) are appropriate for use in all
locations or that transactions, securities, products, instruments
or services discussed herein are available or appropriate for sale
or use in all jurisdictions, or by all investors or counterparties.
Those who utilize this information do so on their own initiative
and are responsible for compliance with applicable local laws or
regulations.********************************************************************
Disclaimer:
http://www.kuleuven.be/cwis/email_disclaimer.htm