Yes, that's fine. Creating Fact objects has a number of advantages (it's more
efficient than building a String, then parsing it; it will use all
significant digits of floating-point values; and it will work for
non-primitive slot values) but this is perfectly fine if none of these issues
affect you.
On Monday 23 April 2007 12:53:04 am rameshs wrote:
> Thanks for the sloution.
>
> i tried it differently and i think it is working.
>
> the way i tried is
>
> str = "(assert ("+entity; str += "("+attribute+" "+value+")"; str
> += "))";
>
> AND
>
> engine.executeCommand(str);
>
> can u suggest whether it is currect or not
>
> Ernest Friedman-Hill wrote:
> > Why not create and assert the facts directly from your Java code? See,
> > for example, here:
> >
> > http://herzberg.ca.sandia.gov/jess/docs/70/library.html#unordered_fact
> >
> > which shows you exactly how to do this.
> >
> > On Friday 20 April 2007 1:16:02 am rameshs wrote:
> >> i am get values to the slots and multislots from user through GUI writen
> >> in
> >> java.
> >>
> >> I have the values in java variables. i have to assert these values.
> >>
> >> i am using this deftemplate
> >>
> >> ( deftemplate emp (slot id (type integer))
> >> ( slot name )
> >> (multislot dept ))
> >>
> >> and i can able to assert using
> >>
> >> (assert (emp(id ?n)(name "raju")))
> >>
> >> and i can bind the value to ?n using
> >>
> >> (bind ?n 101)
> >>
> >> but how can i assign the vaue to ?n using java variable.
> >>
> >> for eg.
> >>
> >> ?n = emp_id;
> >> where emp_id is a java variable to which i will get value from user.
> >>
> >> is it possible
> >>
> >> Thanks in advance
> >
> > --
> > ---------------------------------------------------------
> > Ernest Friedman-Hill
> > Advanced Software Research Phone: (925) 294-2154
> > Sandia National Labs FAX: (925) 294-2234
> > PO Box 969, MS 9012 [EMAIL PROTECTED]
> > Livermore, CA 94550 http://www.jessrules.com
> >
> > --------------------------------------------------------------------
> > To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
> > in the BODY of a message to [EMAIL PROTECTED], NOT to the list
> > (use your own address!) List problems? Notify
> > [EMAIL PROTECTED]
> > --------------------------------------------------------------------
--
---------------------------------------------------------
Ernest Friedman-Hill
Advanced Software Research Phone: (925) 294-2154
Sandia National Labs FAX: (925) 294-2234
PO Box 969, MS 9012 [EMAIL PROTECTED]
Livermore, CA 94550 http://www.jessrules.com
--------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the list
(use your own address!) List problems? Notify [EMAIL PROTECTED]
--------------------------------------------------------------------