OH2 - Checking state after rule received command

rule "test rule"
 when
   Item test_num received command
 then
   logDebug("test", "Command was " + receivedCommand.toString)
end

receivedCommand is a documented magic word in Rules
http://docs.openhab.org/configuration/rules-dsl.html#implicit-variables-inside-the-execution-block