dxl eval_

Hello all,

let suppose that I need to copy a dxl attribute from a DOORS module to another , but I need to check that all attributes referred in this dxl attribute code really exist in the target module where I want to copy this attribute. Could I perform this using eval_ function? 

 

Module A( source module which contains dxl attribute which I want to copy) ---------------> Module B(destination module where I want to copy this dxl attribute)

BUT this dxl attribute refeer other attributes which do not exist in module B. how could I use this eval function for cehck  this issue?


malkeinu - Sun Aug 31 03:53:56 EDT 2014

Re: dxl eval_
Tony_Goodman - Mon Sep 01 05:14:41 EDT 2014

You need checkDXL(), not eval_.

This allows you to check DXL code for errors without actually running it. This is documented in the online help.

Tony

Re: dxl eval_
llandale - Wed Sep 03 14:26:33 EDT 2014

checkDXL_ will trap interpret errors, but it won't trap run errors since it doesn't run the code.  Attempting to create the target attribute with the DXL code likewise traps only interpret errors.

It does not seem practical to parse one DXL to find the names of all attribute "references".

You could use eval_

  • Buffer buf = create()
  • buf += "obj = current\n"
  • buf += "attrDXLName = \"SomeTemporaryAttribute\"\n"
  • buf += code read from the original module's attrDXL
  • string Err = eval_(tempStringOf(buf))

might work.

or deploy the attr in the other module, then

  • noError()
  • Object o = first(mod)
  • string t = o.NameOfNewAttribute  // force execution of the code
  • string Err = lastError()

-Louie