i2 Connect SDK
Search results for

    Show/hide table of contents

    Home > @i2analyze/i2connect > services > IResult > addLink

    services.IResult.addLink() method

    Adds a new link record to the result, whose identifier is a string that you provide.

    Signature:

    addLink<TLinkType extends schema.ILinkType, TFromEnd extends records.ISeededResultEntityRecord | records.IResultEntityRecord, TToEnd extends records.ISeededResultEntityRecord | records.IResultEntityRecord>(type: TLinkType, id: records.ResultRecordId, fromEnd: TFromEnd, toEnd: TToEnd, direction?: data.LinkDirection): records.IResultLinkRecord<TLinkType, TFromEnd, TToEnd, records.ResultRecordId>;
    

    Introduced: API version 1.0

    Type Parameters

    Parameter Type Description
    TLinkType extends schema.ILinkType The type of the new link record.
    TFromEnd extends records.ISeededResultEntityRecord | records.IResultEntityRecord The type of the entity record at the "from" end of the link.
    TToEnd extends records.ISeededResultEntityRecord | records.IResultEntityRecord The type of the entity record at the "to" end of the link.

    Parameters

    Parameter Type Description
    type TLinkType The link type of the new record.
    id records.ResultRecordId An identifier for the new record.
    fromEnd TFromEnd The entity record for the "from" end of the link, which was previously returned from services.IResult.addEntity() or services.IResult.addEntityFromSeed().
    toEnd TToEnd The entity record for the "to" end of the link, which was previously returned from services.IResult.addEntity() or services.IResult.addEntityFromSeed().
    direction data.LinkDirection (Optional) The direction of the new link record, which defaults to "none".

    Returns:

    records.IResultLinkRecord<TLinkType, TFromEnd, TToEnd, records.ResultRecordId>

    The link record that was added to the result.

    Remarks

    The identifier that you provide needs to be unique only for links of the specified type, from the connector that owns the service.

    If there is no suitable identifier for the link in the data source, you can often construct one from the identifiers of the "from" and "to" ends. If there might be more than one link between the same two entities, you will need to add extra identifying information. For example, for a link that represents a financial transaction, you might include a timestamp and perhaps also the amount.

    In this article
    Back to top © N. Harris Computer Corporation