Normally, if you’re doing a musical about James Cagney, casting is a challenge. Not so for the York Theater Company’s “Cagney.” Robert Creighton, who wrote the music and lyrics (with Christopher McGovern), just cast himself. Mr. Creighton does bear a physical resemblance to Cagney, who was 5-foot-5 and resembled a fireplug with a Lower East Side accent. And he does a fine job recreating Cagney’s gangster-vicious movie scenes. But it’s only when he breaks into dance that he seems born for the role. Joshua Bergasse’s choreography, especially in rousing numbers like “You’re a Grand Old Flag” and “Over There,” could sell tap shoes to Tibetan monks. Some major hero worship is going on here. Despite differing accounts of whose idea it was for Cagney’s character to shove a grapefruit in his co-star Mae Clarke’s face in “The Public Enemy” (1931), this musical — the book is by Peter Colley — presents it strictly as Cagney’s on-the-spot inspiration. Cagney is also depicted as a noble advocate for the working man, falsely accused of Communist ties by the Dies Committee (an early version of the House Un-American Activities Committee) and mentally tortured by Jack Warner (Bruce Sabath), the tyrannical Warner Bros. studio chief. Mr. Sabath’s performance actually makes Warner the show’s most interesting character — and maybe the real tough guy.