bridgepoint/ooaofooa.py
def mk_component(bp_model, c_c=None, derived_attributes=False):
    '''
    Create a pyxtuml meta model from a BridgePoint model. 
    Optionally, restrict to classes and associations contained in the
    component c_c.
    '''
    target = Domain()

    c_c_filt = lambda sel: c_c is None or is_contained_in(sel, c_c)
    
    for o_obj in bp_model.select_many('O_OBJ', c_c_filt):
        mk_class(target, o_obj, derived_attributes)
        
    for r_rel in bp_model.select_many('R_REL', c_c_filt):
        mk_association(target, r_rel)
        
    for s_sync in bp_model.select_many('S_SYNC', c_c_filt):
        fn = mk_function(target, s_sync)
        target.add_symbol(s_sync.Name, fn)
    
    for s_dt in bp_model.select_many('S_DT', c_c_filt):
        s_edt = one(s_dt).S_EDT[17]()
        if s_edt:
            enum = mk_enum(s_edt)
            target.add_symbol(s_dt.Name, enum)
        
    for cnst_csp in bp_model.select_many('CNST_CSP', c_c_filt):
        for cnst_syc in many(cnst_csp).CNST_SYC[1504]():
            value = mk_constant(cnst_syc)
            target.add_symbol(cnst_syc.Name, value)
        
    for ass in target.associations:
        ass.formalize()
    
    for s_ee in bp_model.select_many('S_EE', c_c_filt):
        if s_ee.Key_Lett in ['LOG', 'ARCH', 'TIM', 'NVS', 'PERSIST']:
            target.add_symbol(s_ee.Key_Lett, getattr(builtin_ee, s_ee.Key_Lett))
                              
        else:
            ee = mk_external_entity(target, s_ee)
            target.add_symbol(s_ee.Key_Lett, ee)
    
    return target
def mk_component(bp_model, c_c=None, derived_attributes=False):
    '''
    Create a pyxtuml meta model from a BridgePoint model. 
    Optionally, restrict to classes and associations contained in the
    component c_c.
    '''
    target = Domain()

    c_c_filt = lambda sel: c_c is None or is_contained_in(sel, c_c)
    
    for o_obj in bp_model.select_many('O_OBJ', c_c_filt):
        mk_class(target, o_obj, derived_attributes)
        
    for r_rel in bp_model.select_many('R_REL', c_c_filt):
        mk_association(target, r_rel)
        
    for s_sync in bp_model.select_many('S_SYNC', c_c_filt):
        fn = mk_function(target, s_sync)
        target.add_symbol(s_sync.Name, fn)
    
    for s_dt in bp_model.select_many('S_DT', c_c_filt):
        s_edt = one(s_dt).S_EDT[17]()
        if s_edt:
            enum = mk_enum(s_edt)
            target.add_symbol(s_dt.Name, enum)
        
    for cnst_csp in bp_model.select_many('CNST_CSP', c_c_filt):
        for cnst_syc in many(cnst_csp).CNST_SYC[1504]():
            value = mk_constant(cnst_syc)
            target.add_symbol(cnst_syc.Name, value)
        
    for ass in target.associations:
        ass.formalize()
    
    for s_ee in bp_model.select_many('S_EE', c_c_filt):
        if s_ee.Key_Lett in ['LOG', 'ARCH', 'TIM', 'NVS', 'PERSIST']:
            target.add_symbol(s_ee.Key_Lett, getattr(builtin_ee, s_ee.Key_Lett))
                              
        else:
            ee = mk_external_entity(target, s_ee)
            target.add_symbol(s_ee.Key_Lett, ee)
    
    return target
Create a pyxtuml meta model from a BridgePoint model. 
    Optionally, restrict to classes and associations contained in the
    component c_c.