Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Client Driven Transaction Chaining with Criteria

    With server driven transaction chaining, one can filter child data source records using parent record queried by a first query in a queue and criteria binding
    <operationBinding operationType="fetch"> <criteria fieldName="someId" value="$responseData.first.id"/> </operationBinding> Is it possible to accomplish the same without specifying operation binding, but instead setting criteria on the client, e.g., by setting "$responseData.first.id" expression on the client?

    #2
    Yes. Docs are here and the example given is pretty much what you're asking about, but note that the value is provided via dsRequest.fieldValueExpressions, not as a normal criteria value.

    Comment


      #3
      Thanks, got it working.

      Still, can't help and comment on
      1. Please mention in documentation explicitly that expression will work as additional criteria if set for fetch operation.
      2. Processing expressions in criteria objects is much cleaner solution. May be in the some future version? Especially, taken into consideration that Reify will benefit from it.

      Comment


        #4
        Thanks for feedback.

        1. Good idea, the docs focus on adds and updates, we will add an explicit mention that it can be used for criteria

        2. We separated fieldValueExpressions because we thought it would be simpler than forcing custom server code to deal with possible expressions within dsRequest.criteria or dsRequest.values. Having embedded expressions was considered and could still be implemented additively.

        Within Reify, the plan is to basically make it look like you are just editing criteria or values, although under the covers it’s using fieldValueExprsssions.

        Either or both could be sponsored if you want to accelerate the features!

        Comment


          #5
          We wanted to ask though: your use case seems somewhat unusual, since typically, if you want to fetch a master and its details together, you could just fetch the master by PK and the details by passing the master's PK as criteria for the FK field - this wouldn't require fieldValueExpressions.

          Are you in a situation where you are fetching the master by something other than PK, eg by some other criteria, but you know it's going to be unique? Maybe something like loading the "last order" and it's details? That would require fieldValueExpressions, and might make a good example / sample.

          Comment


            #6
            Our case is indeed loading master level using external identifier and a logic for proper version, and then load child records using foreign key. However, this all need to be done in one DB transaction.

            Comment


              #7
              We just updated the Transaction Chaining's docs to mention how dsRequest.fieldValueExpressions can affect the dsRequest.criteria. You will see this update in the docs in the 13.0d and 12.1 versions as of tomorrow's builds (Apr 06).

              Regards
              Isomorphic Software

              Comment

              Working...
              X