Constrained phase-transformation of a TiNi shape-memory alloy