4 Replies Latest reply on Dec 7, 2005 3:37 PM by 474577

    ConditionalCopy matching a DVM value?


      I have a question, I want to do a ConditionalCopy on a value where the value I'm matching should be translated via DVM.

      I have the following message going from System A to System B:
      System A
      -> number
      -> type

      System B

      A DVM PHONE that translates the type variable from System A to System B.

      And I want to copy the "fax" number to the fax variable and the "office" number to the office variable. This is farily simple to do using the CondintialCopy like so:

      ConditionalCopy (phone[v0].number, phone[v0].type, "true", "(%phone.type% == '0050-1')")

      Problem is the "type" is from the "other system" and I also have a third system that has its own "type:s" thus I need to somehow do a DVM before I match the type in the ConditionalCopy like so:

      ConditionalCopy (phone[v0].number, phone[v0].type, "true", "(LookupDVM (%phone.type%, "PHONE", "FALSE") == 'fax')")

      But this does not work so the question is; is there either some way to make this work or some other way to do this?

      // MickeM
        • 1. Re: ConditionalCopy matching a DVM value?

          Would the OAI transform TrueConditionalLookupDVM help here?

          Failing that, you could try a two-stage transform. That is to do a ConditionalCopy on the Publish to Common View, then use LookupDVM on the subscribe side (Common View to Subscribe).

          As a last resort, you could write a custom function, and use the DatabaseOperation transform to call it.

          • 2. Re: ConditionalCopy matching a DVM value?
            Thanx for the reply.

            The TrueConditionalLookupDVM transform does (AFAIK) a DVM resolve on the value not the "expression" thus would not work here.

            I also tried the "two-stage transform" but it seems to me (it also seems reasonable) that you cannot do DVM lookups on the "publish" side which is what I want.
            I sopose I would rework the (CV) message to have fields for the fax/phone number (as opposed to now the array) but as there is a lot of fields and not as nice, but I sopose that would work.

            As for databasetransform, is there some "simple" way to do DVM lookups using the databas transform, I have had a hard time finding information on how to do mappings and such in the docuimentation as well as how the database is organized, though I have done some reversengineering of the database to be able to get some nifty reports from them I sopose I could do the same to find the DVM tables.

            In general I cant fathom why they havent produced a simple expression language as opposed to the "mapping function" as that would have been much more powerfull and easy to use.

            But I think perhaps the best way to resolve this is to go with the two-faced transform. I mean make a hard limit of the possible phone/fax numbers and flatten the CV message. Then have publish side do the ConditionalCopy based on its own values. (though again, that is not "nice" design-wice :)

            // Mickem
            • 3. Re: ConditionalCopy matching a DVM value?

              Do you have a finite list of 'phone' "types"?

              I've just re-read you original post. Am I right in thinking that you want to look at the "type" of number first? Then based on the type, direct the result into correct target field?

              The reason you want to use a DVM is too help direct the end result based on the type of number?

              You can always add conditions to your conditional copy using the OR operator in the wizard.


              fax=ConditionalCopy (phone[v0].number, phone[v0].type, "true", "(%phone.type% == '0050-1')OR"(%phone.type% == 'fax')OR"(%phone.type% == 'facsimile')OR"(%phone.type% == 'not_email')")

              then have another mapping for the phone


              phone=ConditionalCopy (phone[v0].number, phone[v0].type, "true", "(%phone.type% == '0051-1')OR"(%phone.type% == 'phone')OR"(%phone.type% == 'mobile')OR"(%phone.type% == 'cell')")

              • 4. Re: ConditionalCopy matching a DVM value?
                Yes, that is exactly what I want to do!

                And the OR solution might actually be better then the two faced thing above. Atleast it will be less work for me or so I think. But again the problem with not using the DVM is that people in the future will assume (when they change one of the names) that changing the DVM will make the application "work" where as I will have to hardcode things in the :/

                I had hoped that there was some "nice" way to do it but it seems I'll get a messy solution either way.

                Thanx for all the help.

                // MickeM