'Loads the proper when by attributes of elem'

@classmethod
def from_elem(cls, parent, when_elem):

    when_value = when_elem.get('value', None)
    if (when_value is not None):
        return ValueToolOutputActionConditionalWhen(parent, when_elem, when_value)
    else:
        when_value = when_elem.get('datatype_isinstance', None)
        if (when_value is not None):
            return DatatypeIsInstanceToolOutputActionConditionalWhen(parent, when_elem, when_value)
    raise TypeError('When    type    not    implemented')
