commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nestor Urquiza <nest...@yahoo.com>
Subject RE: [scxml] adding an xml to the datamodel
Date Sun, 30 Apr 2006 00:53:41 GMT
Thanks for this and still I cannot get this work
usingthe Data() from my jexl code. I just posted a
reply to Rahul with the issue under this same thread. 

Any help is appreciated. Again I would like my
settings.xml file to be interpreted via XPATH from my
jexl expressions. In that way I to program specific
business rules or decisions since they can be modeles
using the settings.xml file and tested thru conditions
in my scxml file.

Only specific actions need to be programmed which
gives a real power to the Business Protocol Framework
I am implementing.




--- Fasihullah Askiri
<fasihullah.askiri@baypackets.com> wrote:

> Hi
> You can see a loads of example on the net for
> digester usage. This is how you can do it.
> 
> public void process() {
> 	Digester digester = new Digester();
> 	digester.push(new TestDigester());
> 	digester.addRule("scenarios/scenario/junk", new
> NodeCreateRule());
> 	digester.addSetNext("scenarios/scenario/junk",
> "addJunk");
> 	digester.parse(TestDigester.class.getClassLoader()
> 			.getResourceAsStream("scenario.xml"));
> }
> public void addJunk(Element e) {
> 	Data d = new Data("name");
> 	d.setNode(e);
> 	getDocument().getDataModel().addData(data);
> }
> 
> 
> +Fasih
> -----Original Message-----
> From: Nestor Urquiza [mailto:nestoru@yahoo.com]
> Sent: Fri 4/28/2006 8:26 AM
> To: Jakarta Commons Users List
> Subject: RE: [scxml] adding an xml to the datamodel
>  
> I have it parsed yes. But it is not a problem since
> everything can be converted to InputStreams for
> example.
> 
> In any case I am then interested in the code you
> have
> for applying the rule. I see Datamodel#setNode()
> method and i think it can be the solution but I do
> not
> know how to use it.
> Something like :
> <pseudo>
> datamodel.setNode(InputStream)
> </pseudo>
> would be a logical solution for example ... botton
> line is the rule coded in the current commons-scxml
> core/samples or it is code you made? and in any case
> could you share it?
> thanks!
> 
> --- Fasihullah Askiri
> <fasihullah.askiri@baypackets.com> wrote:
> 
> > Do you have the external file as a file, I mean,
> > have you parsed it? if not, you can get the
> digester
> > to add the content. For e.g. this is what I do
> > 
> > scenario.xml
> > ------------
> > <my_data>
> > <data include="yes" value="afdsdf"/>
> > </my_data>
> > 
> > When I digest this file, I have a rule which puts
> it
> > in the datamodel if it sees include=yes. You will
> > notice that the content is still name,value pair
> and
> > not an "XML" per se which you might use to do an
> > Xpath query maybe.
> > 
> > +Fasih
> > 
> > 
> > -----Original Message-----
> > From: Nestor Urquiza [mailto:nestoru@yahoo.com]
> > Sent: Fri 4/28/2006 7:34 AM
> > To: Jakarta Commons Users List
> > Subject: [scxml] adding an xml to the datamodel
> >  
> > Hello guys,
> > Here I am trying to include my external xml file
> > into
> > the model using the snippet posted by Fasih:
> > 
> > //byteArraySettingsFileContent has the external
> xml
> > file content 
> > Data scenarioData = new Data();
> > //I need to understand how to set a node here with
> > the
> > content of the above file.
> > /* The Fasih sippet was for setting up String
> > variables:
> > scenarioData.setName(Constants.SCENARIO_ID_PARAM);
> > scenarioData.setExpr("the content of the var
> here");
> >  
> >          
> > scxml.setDatamodel(new Datamodel());
> > scxml.getDatamodel().addData(scenarioData);
> > 
> > Thanks you all,
> > Nestor
> > 
> > __________________________________________________
> > Do You Yahoo!?
> > Tired of spam?  Yahoo! Mail has the best spam
> > protection around 
> > http://mail.yahoo.com 
> > 
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> > commons-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail:
> > commons-user-help@jakarta.apache.org
> > 
> > 
> > 
> > 
> > 
> > >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> > commons-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail:
> commons-user-help@jakarta.apache.org
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam
> protection around 
> http://mail.yahoo.com 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> commons-user-help@jakarta.apache.org
> 
> 
> 
> 
> 
> >
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
commons-user-help@jakarta.apache.org


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message