CompositeTriggerType m = (CompositeTriggerType) mType;
result = new CompositeTriggerType(mType.getUID(), mType.getConfigurationDescriptions(), mType.getLabel(),
mType.getDescription(), mType.getTags(), mType.getVisibility(), m.getOutputs(),
new ArrayList<>(m.getChildren()));
TriggerType m = (TriggerType) mType;
result = new TriggerType(mType.getUID(), mType.getConfigurationDescriptions(), mType.getLabel(),
mType.getDescription(), mType.getTags(), mType.getVisibility(), m.getOutputs());
mType.getDescription(), mType.getTags(), mType.getVisibility(), m.getInputs(),
new ArrayList<>(m.getChildren()));
ConditionType m = (ConditionType) mType;
result = new ConditionType(mType.getUID(), mType.getConfigurationDescriptions(), mType.getLabel(),
mType.getDescription(), mType.getTags(), mType.getVisibility(), m.getInputs());
mType.getDescription(), mType.getTags(), mType.getVisibility(), m.getInputs(), m.getOutputs(),
new ArrayList<>(m.getChildren()));
ActionType m = (ActionType) mType;
result = new ActionType(mType.getUID(), mType.getConfigurationDescriptions(), mType.getLabel(),
mType.getDescription(), mType.getTags(), mType.getVisibility(), m.getInputs(), m.getOutputs());
} else {
throw new IllegalArgumentException("Invalid template type:" + mType);