JESS: [EXTERNAL] How to negate a variable when in lhs of a rule

"Hunter McMillen" <[email protected]> Wed, 11 Jan 2012 14:38:31 -0500
Newsgroups gmane.comp.java.jess
Message-ID <CABWUPR2--9UT6GDee0hSAYuomW9A1-Xjwm5G-DCQq+cpa3crtw@mail.gmail.com>
Hi everyone,

I am trying to differentiate between Objects that belong to a certain user
inside two of my rules.

I have a variable created from Java like this:

*engine.getGlobalContext().setVariable("PLAYER_ID", new
Value(player.getID());*
*
*
And I want to use this variable in rules to determine which objects belong
to each player.

This rule works fine when just using ?PLAYER_ID
*(defrule myUnitSeen *
*   (unit (ID ?id) (typeID ?typeID) (player ?PLAYER_ID))*
*=>*
* .....)*
*
*
But when I try to negate the variable I get an error, "First use of
variable negated: PLAYER_ID"
*(defrule enemyUnitSeen *
*   (unit (ID ?id) (typeID ?typeID) (player ~?PLAYER_ID))*
*=>*
* .....)*
*
*
How can I specify anything other than ?PLAYER_ID on the lhs of a rule?

Thanks,
Hunter McMillen