Skip to main content
1-Visitor
July 13, 2015
Question

To Fetch PTC server system Attributes in Image element in XML

  • July 13, 2015
  • 0 replies
  • 580 views

twowaymetadatarule doesnt support for graphic object ,but PTC Server system attributes can be pulled into XML documents via ACL

Below is the Logic implemented:

init.acl

function initialize() {

utils::initHooks();

}

initialize();

utils.acl

initialize callbacks to handle CMS session handle

function Callbacks() {

  sess_add_callback(SIM_SESSHDL, "checkin", "utils::checkin_callback");

  sess_add_callback(SIM_SESSHDL, "create", "utils::create_callback");

}

function checkin_callback(dobj, docid, ud) {

local firstoid = dobj_first_oid(dobj);

local checkindoc = oid_doc(firstoid);

graphicnumber(checkindoc);

doc_save(checkindoc);

  return 0;

}

function create_callback( name, folder, opts, first, last, version, objtype, ud ) {

    local doc = oid_doc(first);

  graphicnumber(doc);

  doc_save(doc);

  return 0;

}

function graphicnumber(doc)

{

// write your business logic to get windchill no

something like

local number = dobj_get_attr(imagedobj,"WC_NUMBER_ATTR");

}