Writing to a rule object
Hello Everyone,
I want to write a list of items into a rule object from a Form field. I am not finding a suitable method in rule object to perform the task, I tried using getExpression and setExpression but these methods return ExNode object which doesn't have any suitable method to implement add.
Any pointer will be highly appreciated.
Cheers !!
Saurabh
[388 byte] By [
Agraharia] at [2007-11-27 2:22:14]

# 2
Hope the code below helps:
-
<WFProcess name='Rule Creator' maxSteps='0'>
<Variable name='ruleView'/>
<Activity id='0' name='start'>
<Transition to='create rule'/>
<WorkflowEditor x='90' y='244'/>
</Activity>
<Activity id='1' name='end'>
<WorkflowEditor x='310' y='294'/>
</Activity>
<Activity id='2' name='create rule'>
<Action id='0' name='create rule view'>
<expression>
<block trace='true'>
<set name='ruleObj'>
<Object/>
</set>
<invoke name='setAttributes'>
<ref>roleObj</ref>
<map>
<s>name</s>
<s>My New Rule</s>
</map>
</invoke>
<invoke name='toMap'>
<ref>ruleObj</ref>
</invoke>
<set name='ruleView'>
<Object/>
</set>
<invoke name='setId'>
<ref>ruleView</ref>
<s>RuleViewer:MyNewRule</s>
</invoke>
<set name='ruleView.rule.name'>
<s>MyNewRuleName</s>
</set>
<set name='ruleView.rule.expression.xml'>
<s><list> <s>Value1</s> <s>Value2</s> </list></s>
</set>
</block>
</expression>
</Action>
<Action id='1' name='trace view'>
<expression>
<block trace='true'>
<s>$$$$$$$$$$$$$$$$$$$$$$$$$$$</s>
<invoke name='toMap'>
<ref>ruleView</ref>
</invoke>
</block>
</expression>
</Action>
<Action id='2' name='checkin rule view' application='com.waveset.session.WorkflowServices'>
<Argument name='op' value='checkinView'/>
<Argument name='view'>
<ref>ruleView</ref>
</Argument>
</Action>
<Transition to='end'/>
<WorkflowEditor x='185' y='271'/>
</Activity>
</WFProcess>