@Override
	public boolean applyTo(Program program, TaskMonitor monitor) {
		ProgramModule root = program.getListing().getRootModule(treeName);

		try {
			boolean status = changeModel(program, root, monitor);
			if (status && getStatusMsg() != null && tool != null) {
				tool.setStatusInfo(getStatusMsg());
			}
			return status;
		}
		catch (NotFoundException e) {
			setStatusMsg("Error moving code units: " + e);
		}
		catch (Exception e) {
			String msg = e.getMessage();
			if (msg == null) {
				msg = e.toString();
			}
			setStatusMsg("Error invoking model " + modelName + ": " + msg);
			Msg.error(this, "Unexpected Exception: " + e.getMessage(), e);
		}
		return false;
	}
Constructor

@param groupPath group path of the affected Module or Fragment
@param treeName name of the tree where group exists
@param blockModelService service that has the known block models
@param modelName name of the model to use
Ghidra/Features/Base/src/main/java/ghidra/app/cmd/module/SubroutineModelCmd.java