Strange if/null behaviour

As Crispin indicated, if you initialize a variable to null, you have to provide the type because they’re has nothing to tell the rules engine what type it is.

You need to provide more context but I suspect the answer in Rules DSL is no. But I don’t know what ScriptServiceUtil.getItemRegistry.getItem(itemName) returns when the item by that name doesn’t exist. Maybe it just returns null. See Design Pattern: Associated Items for details.