They behave differently only for non-root token variables. Variables are always associated with tokens. If you don't specify one, it assumes the root token. With createVariable, jBPM will create the variable on the given token. With setVariable, it'll look for the token which has the variable (which may be any parent of the given token), and then set its value.