Thanks again Alan and I understand what your saying,
but the fields where the blank values will be unknown.
Therefore to allow any of them to be random I would
have to make a useless rule using ? as the varible for
everything but the actual service. So even though we
would like to match to empty fields ...or some random
prechoosen value, we still need the other feilds so
that the rule won't fire on every entry.

just to help in giving you all am idea in what im
trying to do here is another try I made at it:
?newserv <- (webservice (service ?service) (project
?project|?) (org ?org|?) (analystname
?analystname|?) (analystrole ?analystrole|?)
(priority ?priority|?) (reldatetime
?reldatetime|?) (location ?location|?) (action
run) )

...maybe I dont underst and the '|' operator on the
left-hand side, but I thought that meant 'or', but
this wont fire for me either.

thanks again
-Jerome BG


--- Alan Moore <[EMAIL PROTECTED]> wrote:

> Jerome,
> 
> You can match against ordered facts like so:
> 
> (defrule myRule
>     (first second ? fourth fifth ? seventh)
> =>
>     (printout t "Rule fired")
> )
> 
> What this does is to match any of the following
> facts:
> 
> (assert (first second dontcare fourth fifth dontcare
> seventh))
> (assert (first second anything fourth fifth here
> seventh))
> (assert (first second x fourth fifth y seventh))
> (assert (first second nil fourth fifth nil seventh))
> 
> The question marks in the rule above will make the
> rule pattern match 
> facts with the specified values (e.g. first, second,
> etc.) at the 
> positions indicated and with *any* value at ordinal
> position 3 and 6". 
> In this case the question marks are unnamed
> variables that get bound to 
> whatever is at those positions in the matching
> fact(s).
> 
> You could bind named variables like so:
> 
> (defrule myRule
>     (first second ?position3 fourth fifth ?position6
> seventh)
> =>
>     (printout t "Rule fired - values at position 3
> and 6 are " 
> ?position3 ", " ?position6)
> )
> 
> I would suggest that you try a simplified version of
> your rule cut down 
> to just one or two fields and experiment with how
> the pattern matching 
> works.
> 
> > (defrule run-service
> >    ?inputservice <- (inputservice ?service
> ?project
> > ?org ?analystname ?analystrole ?priority
> ?reldatetime
> > ?location)
> >    ?newserv <- (webservice (service ?service)
> (project
> > ?project) (org ?org) (analystname ?analystname)
> > (analystrole ?analystrole) (priority ?priority)
> > (reldatetime ?reldatetime) (location ?location)
> > (action run) )
> > =>
> >   (store RETURN "run")
> >   (printout t "JESS: Found an existing service = "
> > ?service crlf)
> >   (printout t "JESS: The user-specified action is
> to
> > run the service! " crlf)
> >   (retract ?inputservice))
> 
> If this rule isn't firing for you and you think it
> should, try removing 
> some of the slot matches in the second pattern.
> Maybe one or more of the 
>   slot values aren't *exactly* the same in both
> facts and so are 
> preventing them from matching. Start with only one
> or two slots and keep 
> adding them back until the rule stops firing. For
> example,
> 
> (defrule run-service
>     ?inputservice <- (inputservice ?service ?project
> ?org ?analystname 
> ?analystrole ?priority ?reldatetime ?location)
>     ?newserv <- (webservice (service ?service)
> (action run) )
> =>
>    (store RETURN "run")
>    (printout t "JESS: Found an existing service = "
> ?service crlf)
>    (printout t "JESS: The user-specified action is
> to run the service! " 
> crlf)
>    (retract ?inputservice)
> )
> 
> Good luck!
> 
> alan
> 
>
--------------------------------------------------------------------
> 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]
>
--------------------------------------------------------------------
> 
> 



                
__________________________________ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.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]
--------------------------------------------------------------------

Reply via email to