The present invention provides compounds of formula (I) or its pharmaceutically acceptable salt, and wherein T, J, R, R4, Rq, o, RA, W and RB and its subset are as described in specification. Compound is the inhibitor of NAMPT and is therefore that can be used for treating cancer, the autoimmune disease that inflammatory disorders and/or T cell mediate.