Пример #1
0
def flowdetail_create(name, wf, fd_id=None):
    """Create a new FlowDetail model with matching fd_id"""
    # Create a FlowDetail model to be saved
    fd_ref = models.FlowDetail()
    # Update attributes of FlowDetail model to be saved
    fd_ref.name = name
    if fd_id:
        fd_ref.flowdetail_id = fd_id
    # Save FlowDetail model to database
    fd_ref.save()
Пример #2
0
def _convert_fd_to_internal(fd, parent_uuid):
    fd_m = models.FlowDetail(name=fd.name,
                             uuid=fd.uuid,
                             parent_uuid=parent_uuid,
                             meta=fd.meta,
                             state=fd.state)
    fd_m.atomdetails = []
    for ad in fd:
        fd_m.atomdetails.append(_convert_ad_to_internal(ad, fd_m.uuid))
    return fd_m
Пример #3
0
def _convert_fd_to_internal(fd, lb_uuid):
    fd_m = models.FlowDetail(name=fd.name,
                             uuid=fd.uuid,
                             parent_uuid=lb_uuid,
                             meta=fd.meta,
                             state=fd.state)
    fd_m.taskdetails = []
    for td in fd:
        fd_m.taskdetails.append(_convert_td_to_internal(td, fd_m.uuid))
    return fd_m