Showing results for 
Search instead for 
Did you mean: 
Showing results for 
Search instead for 
Did you mean: 

The PTC Community email address has changed to Learn more.

Check status of change tracking


Check status of change tracking


I have the below ACL code:

alias copyfit1 {
set changetracking=off
insert_pi 'xpp copyfittext1';
set changetracking=on}
map F1 copyfit1

As you can see that a PI is inserted. Our requirement is to turn the change tracking off when this PI is inserted. In the above code I could able to achieve this. But here is my issue - I do not want change tracking to be turned on when the PI is inserted for a docuemnt where we do not need change tracking at all i.e., if the document does not to be tracked whereas this PI should be inserted I do not want change tracking to be turned on after inserting the PI. For this can I check the status of change tracking in a document and have the code act according to the status of change tracking in the document.

Thanks in advance.



Hi Karthik-

You can use doc_get(current_doc(),'changetracking') to get the current
state of change tracking (where 1=on, 0=off). Try something like this:

function copyfit1 (doc=current_doc()) {

# save current state of changetracking

local $ct = doc_get(doc,'changetracking');

# turn off change tracking for PI insertion


insert_pi 'xpp copyfittext1';

# restore previous changetracking state



map F1 copyfit1();




Thanks a million. It works.


It was working till today but one of the user had bought up an issue on this:-(

When you insert this PI in non-tracked section, the PI is inserted without change tracking. However if we insert the PI on a existing change tracking section it is still tracked. See the screenshots attached.

I understand that the PI is been tracked because it is inside <atict:...> markup. So the only solution is to read the type of change track (add or deleted) close it before the PI and reopen it after PI.

How do I handle this? If ACL can't help I have to look for XSLT may be.


Hi Karthik-

That's right, but it may be more complicated than you realize. Your
strategy will work as long as the tracked change is just text inside an
element, but consider the following case where the user has inserted an
entire paragraph:

<atict:add><para>Here is some text (insert PI here -> <-), blah blah

In this case, you can't just close the <atict:add>, insert the PI, and
then open a new <atict:add> element, because then you'd have crossed
elements and your document would no longer be well-formed XML.

Is the case of inserting the PI into an already-existing tracked change
really a problem? Presumably, if a change is already tracked, then
either a) the change will be accepted, at which point the PI will be
preserved along with the change, or b) the change will be rejected, in
which case you probably want the PI to disappear with the rejected
change anyway.