Ummmm, no way to define the Java class in any way? Otherwise I'd have to
touch all the rules ...
Thanks a lot,
tge
friedman_hill ernest j wrote:
>
> You can use str-cat to turn a symbol into a string:
>
> (defrule update-simple
> ?f <- (The simple object ?id is ?val)
> ?o <- (Simple (OBJECT ?s) (name ?&=(str-cat ?id)))
> =>
> ...
> )
>
> I think Thomas Gentsch wrote:
> >
> > I have another one ... :~)
> >
> > When extending the 'Simple' example a little, I encountered a problem, I
> > understand but have no idea yet, how to do it right.
> >
> > The class 'Simple' is defined as:
> >
> > public class Simple
> > {
> > private String m_name;
> > ...
> >
> > Now, if I have a rule:
> >
> > (defrule update-simple
> > ?f <- (The simple object ?id is ?val)
> > ?o <- (Simple (OBJECT ?s) (name ?id))
> > =>
> > ...
> > )
> >
> > I can only get the rule to fire if I assert a fact
> > (The simple object \"bla\" is 100)
> >
> > i.e. with the id in double qoutes. Make sense, because then both are a
> > string. But I want to match facts
> > (The simple object bla is 100)
> >
> > Is there an elegant way to accomplish this? I experimented with m_name
> > being of class jess.Value but couldn't get it to work.
> >
> > Many thanks,
> > tge
> >
> > --
> > Thomas Gentsch
> >
---------------------------------------------------------------------
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]
---------------------------------------------------------------------