Exemplo n.º 1
0
 def create_behavior(self,id=None,description=None,ordinal_position=None,status=None,duration=None,behavior_purpose=None,discovery_method=None,action=None,action_equivalence_reference=None,
                     action_reference=None,associated_code=None):
     behavior = Behavior(id=id,description=description)
     behavior.ordinal_position = ordinal_position
     behavior.status = status
     behavior.duration = duration
     if isinstance(behavior_purpose,BehaviorPurpose):
         behavior.purpose = behavior_purpose
     behavior.discovery_method = discovery_method
     if action is not None or action_equivalence_reference is not None or action_reference is not None:
         behavior.action_composition= BehavioralActions()
         behavior.action_composition.action= action
         behavior.action_composition.action_reference= action_reference
         behavior.action_composition.action_equivalence_reference = action_equivalence_reference
     if associated_code is not None:
         behavior.associated_code = AssociatedCode()
         for code in associated_code:
             if isinstance(code,Code):
                 behavior.associated_code.append(code)
     return behavior