1
0
-1
com.avoka.tm.svc.PropertyBuilder appears to have a defect when trying to create a client property.

The underlying service PropertyValueService does not accept client code, but instead accepts client name.

I can see two paths.

  1. PropertyBuilder is changed to accept client name. If this is done, then client name needs to be made available on the SvcDef object or through some other means.
  2. PropertyValueService is either changed or a new method is added to handle client code.


Sample Script:



import com.avoka.core.groovy.GroovyLogger as logger
import com.avoka.tm.svc.PropertyBuilder

try {
  new PropertyBuilder()
    .setName( 'example-by-client-name' )
    .setValue( 'example-by-client-name' )
    .setClientCode( '{{ClientName}}' )
    .build()
  logger.info "Success"
} catch (Throwable e) {
  logger.error e
}

try {
  new PropertyBuilder()
    .setName( 'example-by-client-code' )
    .setValue( 'example-by-client-code' )
    .setClientCode( '{{ClientCode}}' )
    .build()
  logger.info "Success"
} catch (Throwable e) {
  logger.error e
}
    CommentAdd your comment...

    3 answers

    1.  
      2
      1
      0

      Hey Adam, this looks like a defect. The product team are reviewing it. Thanks for bringing it to our attention.

      Tracking reference number: TPD-5343

        CommentAdd your comment...
      1.  
        1
        0
        -1

        Hi,

        just wondering if there is a work around for this issue?

        I am trying to set an Organisation Property using a service, but get either and error, or no property create/update.

        If I use setClientCode("clientCode") I get an error: "Property Value Service Error: clientName = 'clientCode"

        However, if I use setClientCode("clientName") there is no error, but the property is not created or updated.

        Any feedback would be appreciated.

        Thanks

        1. Mark Murray

          Hi All,

          I think I may have some progress.

          It seems that the Unit Test does not create or update the property. However, if I run the service as a Scheduled Job it works as expected (pending some further testing).

          Hope this helps others.

          Thanks

        CommentAdd your comment...
      2.  
        1
        0
        -1

        You are mixing classes from the Fluent SDK with the Legacy API.

        The PropertyBuilder class is part of the Fluent SDK where the PropertyValueService is not. To retrieve the value of the property in the Fluent SDK use PropertyQuery (which supports clientCode).

        1. Adam Kaplan

          This issue is about creating/updating a property not looking one up.

          The sample script is using only fluent classes, so a mix of fluent and Legacy is not the issue either.

          Also, this is on TM version 5.1.3

        2. Ben Warner

          I see, apologies I misunderstood.

        3. Ben Warner

          Can you confirm which version of the Fluent SDK you are using?

        4. Ben Warner

          Are you getting a compile error or runtime error? Can you provide the error message?

        5. Adam Kaplan

          Runtime, specifically an ApplicationException.

        CommentAdd your comment...