Value association

Prev Next

This article describes how to associate values with Nexus Value Translator using it's api.

Who should associate?

Most often the responsibility for associating values lands on the system adapters, who should make the association when they don't recognize an Id value, because it's on the form of a "SourceInstancePath" (see below). They should then create an instance object in their system and associate that id value with the SourceInstancePath they received.

Another scenario for associations are one-time batch jobs.

Vocabulary

There are a few terms you have to know:

  • Concept
    • A property of an entity, e.g. "person.id", "person.gender", "product.id", that have different values in different systems.
    • These are either id:s (dynamically created) or enumerations (a fixed set of values).
    • For associations, it's almost always id concepts.
  • Context
    • A system uses a set of values for a certain concept, usually it's own id:s from a database. But it could be a more generic source as well, e.g. some iso standard for country codes.
    • This is called the "context".
  • Client
    • Technical name of each "client" participating in value translation, typically system adapters, mobile apps and webs.
    • A client has a Context for each Concept.
  • SourceInstancePath
    • Describes a value for a client for a certain Concept.
    • Has the form ([concept]!~[client]![value]), e.g.
      • (person.gender!~crm-lime!female)
      • (product.id!~haze-adapter!7881).
  • TargetClientName
    • The client to get the translation for/make the association for.
  • (TargetContextName)
    • Instead of specifying the target client, you could specify the target context, but stick with client as long as you can.
  • TargetValue
    • The value in the target context.
  • SourcePath
    • Like SourceInstancePath, but without the value.
    • ([concept]!~[client]), e.g.
      • (person.gender!~crm-lime)
      • (product.id!~mobile-app).
  • LockId
    • When associating, the aquired lock.

Association steps

1. Aquire a lock

To make sure that two processes don't associate at the same time, a lock is required. To get a lock, call the TranslateOrLock (PRDSIM Swagger) method. If an association was already done, we will get a translated value, but most often it will give us a LockId.

2. Create the association

With the lock, POST a request to CreateAssociation (PRDSIM Swagger) with a body containing the relevant attributes described above.

3. Release the lock

To finish up, release the lock using ReleaseLock (PRDSIM Swagger)

Got feedback?

There is more to Nexus Value Translation; please contact us if you wish for us to extend this documentation.