1 // Copyright (C) 2014-2019 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 #include <Model_Session.h>
21 #include <ModelAPI_Feature.h>
22 #include <ModelAPI_Plugin.h>
23 #include <Model_Data.h>
24 #include <Model_Document.h>
25 #include <Model_Objects.h>
26 #include <Model_Application.h>
27 #include <Model_Events.h>
28 #include <Model_Validator.h>
29 #include <ModelAPI_Events.h>
30 #include <Events_Loop.h>
31 #include <Events_InfoMessage.h>
32 #include <Config_FeatureMessage.h>
33 #include <Config_AttributeMessage.h>
34 #include <Config_ValidatorMessage.h>
35 #include <Config_ModuleReader.h>
36 #include <Config_ValidatorReader.h>
37 #include <Config_PluginMessage.h>
39 #include <ModelAPI_CompositeFeature.h>
40 #include <ModelAPI_ResultPart.h>
41 #include <ModelAPI_Tools.h>
43 #include <TDF_ChildIDIterator.hxx>
44 #include <TDF_CopyTool.hxx>
45 #include <TDF_DataSet.hxx>
46 #include <TDF_RelocationTable.hxx>
47 #include <TDF_ClosureTool.hxx>
49 #include <TNaming_Builder.hxx>
50 #include <TNaming_Iterator.hxx>
51 #include <TNaming_NamedShape.hxx>
53 #include <TopoDS_Shape.hxx>
55 static Model_Session* myImpl = new Model_Session();
57 // to redirect all calls to the root document
58 #define ROOT_DOC std::dynamic_pointer_cast<Model_Document>(moduleDocument())
60 bool Model_Session::load(const char* theFileName)
62 bool aRes = ROOT_DOC->load(theFileName, "root", ROOT_DOC);
66 bool Model_Session::save(const char* theFileName, std::list<std::string>& theResults)
68 return ROOT_DOC->save(theFileName, "root", theResults);
71 void Model_Session::closeAll()
73 Model_Application::getApplication()->deleteAllDocuments();
74 static const Events_ID aDocChangeEvent = Events_Loop::eventByName(EVENT_DOCUMENT_CHANGED);
75 static std::shared_ptr<Events_Message> aMsg(new Events_Message(aDocChangeEvent));
76 Events_Loop::loop()->send(aMsg);
77 Events_Loop::loop()->flush(aDocChangeEvent);
80 void Model_Session::startOperation(const std::string& theId, const bool theAttachedToNested)
82 myOperationAttachedToNext = theAttachedToNested;
83 ROOT_DOC->startOperation();
84 ROOT_DOC->operationId(theId);
85 static std::shared_ptr<Events_Message> aStartedMsg
86 (new Events_Message(Events_Loop::eventByName("StartOperation")));
87 Events_Loop::loop()->send(aStartedMsg);
88 // remove all useless documents that has been closed: on start of operation undo/redo is cleared
89 // MPV: this code is dangerous now because it may close the document that is activated right now
90 // but not in the list of the opened documents yet (create, delete, undo, activate Part)
91 // later this must be updated by correct usage of uniques IDs of documents, not names of results
92 //std::list<std::shared_ptr<ModelAPI_Document> > aUsedDocs = allOpenedDocuments();
93 //Model_Application::getApplication()->removeUselessDocuments(aUsedDocs);
96 void Model_Session::finishOperation()
98 setCheckTransactions(false);
99 ROOT_DOC->finishOperation();
100 if (myOperationAttachedToNext) { // twice, with nested
101 ROOT_DOC->finishOperation();
102 myOperationAttachedToNext = false;
104 setCheckTransactions(true);
107 void Model_Session::abortOperation()
109 setCheckTransactions(false);
110 ROOT_DOC->abortOperation();
111 if (myOperationAttachedToNext) { // twice, with nested
112 ROOT_DOC->abortOperation();
113 myOperationAttachedToNext = false;
115 setCheckTransactions(true);
116 // here the update mechanism may work after abort, so, suppress the warnings about
117 // modifications outside of the transactions
118 bool aWasCheck = myCheckTransactions;
119 myCheckTransactions = false;
120 static std::shared_ptr<Events_Message> anAbortMsg
121 (new Events_Message(Events_Loop::eventByName("AbortOperation")));
122 Events_Loop::loop()->send(anAbortMsg);
123 myCheckTransactions = true;
124 myCheckTransactions = aWasCheck;
127 bool Model_Session::isOperation()
129 return ROOT_DOC->isOperation();
132 bool Model_Session::isModified()
134 return ROOT_DOC->isModified();
137 bool Model_Session::canUndo()
139 return ROOT_DOC->canUndo();
142 void Model_Session::undo()
144 setCheckTransactions(false);
146 setCheckTransactions(true);
149 bool Model_Session::canRedo()
151 return ROOT_DOC->canRedo();
154 void Model_Session::redo()
156 setCheckTransactions(false);
158 setCheckTransactions(true);
161 //! Returns stack of performed operations
162 std::list<std::string> Model_Session::undoList()
164 return ROOT_DOC->undoList();
166 //! Returns stack of rolled back operations
167 std::list<std::string> Model_Session::redoList()
169 return ROOT_DOC->redoList();
172 ModelAPI_Plugin* Model_Session::getPlugin(const std::string& thePluginName)
174 if (myPluginObjs.find(thePluginName) == myPluginObjs.end()) {
175 // before load the used plugins
176 if (myUsePlugins.find(thePluginName) != myUsePlugins.end()) {
177 std::string aUse = myUsePlugins[thePluginName];
178 std::stringstream aUseStream(aUse);
179 std::string aPluginName;
180 while (std::getline(aUseStream, aPluginName, ',')) {
181 if (myPluginObjs.find(aPluginName) == myPluginObjs.end())
182 getPlugin(aPluginName);
185 // load plugin library if not yet done
186 Config_ModuleReader::loadPlugin(thePluginName);
188 if (myPluginObjs.find(thePluginName) == myPluginObjs.end()) {
189 Events_InfoMessage("Model_Session", "Can not load plugin '%1'").arg(thePluginName).send();
192 return myPluginObjs[thePluginName];
195 FeaturePtr Model_Session::createFeature(std::string theFeatureID, Model_Document* theDocOwner)
197 if (this != myImpl) {
198 return myImpl->createFeature(theFeatureID, theDocOwner);
201 // load all information about plugins, features and attributes
204 if (myPlugins.find(theFeatureID) != myPlugins.end()) {
205 std::pair<std::string, std::string>& aPlugin = myPlugins[theFeatureID]; // plugin and doc kind
206 if (!aPlugin.second.empty() && aPlugin.second != theDocOwner->kind()) {
207 Events_InfoMessage("Model_Session",
208 "Feature '%1' can be created only in document '%2' by the XML definition")
209 .arg(theFeatureID).arg(aPlugin.second).send();
212 ModelAPI_Plugin* aPluginObj = getPlugin(aPlugin.first);
214 FeaturePtr aCreated = aPluginObj->createFeature(theFeatureID);
216 Events_InfoMessage("Model_Session", "Can not initialize feature '%1' in plugin '%2'")
217 .arg(theFeatureID).arg(aPlugin.first).send();
221 Events_InfoMessage("Model_Session", "Can not load plugin '%1'").arg(aPlugin.first).send();
224 Events_InfoMessage("Model_Session",
225 "Feature '%1' not found in any plugin").arg(theFeatureID).send();
228 return FeaturePtr(); // return nothing
231 std::shared_ptr<ModelAPI_Document> Model_Session::moduleDocument()
233 Handle(Model_Application) anApp = Model_Application::getApplication();
234 bool aFirstCall = !anApp->hasRoot();
236 // to be sure that plugins are loaded,
237 // even before the first "createFeature" call (in unit tests)
240 // creation of the root document is always outside of the transaction, so, avoid checking it
241 setCheckTransactions(false);
242 anApp->createDocument(0); // 0 is a root ID
243 // creation of the root document is always outside of the transaction, so, avoid checking it
244 setCheckTransactions(true);
246 return anApp->rootDocument();
249 std::shared_ptr<ModelAPI_Document> Model_Session::document(int theDocID)
251 return std::shared_ptr<ModelAPI_Document>(
252 Model_Application::getApplication()->document(theDocID));
255 bool Model_Session::hasModuleDocument()
257 return Model_Application::getApplication()->hasRoot();
260 std::shared_ptr<ModelAPI_Document> Model_Session::activeDocument()
262 if (!myCurrentDoc || !Model_Application::getApplication()->hasDocument(myCurrentDoc->id()))
263 myCurrentDoc = moduleDocument();
267 /// makes the last feature in the document as the current
268 static void makeCurrentLast(std::shared_ptr<ModelAPI_Document> theDoc) {
270 FeaturePtr aLast = std::dynamic_pointer_cast<Model_Document>(theDoc)->lastFeature();
271 // if last is nested into something else, make this something else as last:
272 // otherwise it will look like edition of sub-element, so, the main will be disabled
274 CompositeFeaturePtr aMain = ModelAPI_Tools::compositeOwner(aLast);
277 aMain = ModelAPI_Tools::compositeOwner(aLast);
280 theDoc->setCurrentFeature(aLast, false);
284 void Model_Session::setActiveDocument(
285 std::shared_ptr<ModelAPI_Document> theDoc, bool theSendSignal)
287 if (myCurrentDoc != theDoc) {
288 if (myCurrentDoc.get())
289 myCurrentDoc->setActive(false);
291 theDoc->setActive(true);
293 std::shared_ptr<ModelAPI_Document> aPrevious = myCurrentDoc;
294 myCurrentDoc = theDoc;
295 if (theDoc.get() && theSendSignal) {
296 // this must be before the synchronization call because features in PartSet lower than this
297 // part feature must be disabled and don't recomputed anymore (issue 1156,
298 // translation feature is failed on activation of Part 2)
299 if (isOperation()) { // do it only in transaction, not on opening of document
300 DocumentPtr aRoot = moduleDocument();
301 if (myCurrentDoc != aRoot) {
302 FeaturePtr aPartFeat = ModelAPI_Tools::findPartFeature(aRoot, myCurrentDoc);
303 if (aPartFeat.get()) {
304 aRoot->setCurrentFeature(aPartFeat, false);
308 // synchronize the document: it may be just opened or opened but removed before
309 std::shared_ptr<Model_Document> aDoc = std::dynamic_pointer_cast<Model_Document>(theDoc);
311 bool aWasChecked = myCheckTransactions;
312 setCheckTransactions(false);
313 TDF_LabelList anEmptyUpdated;
314 aDoc->objects()->synchronizeFeatures(anEmptyUpdated, true, true, false, true);
316 setCheckTransactions(true);
318 static std::shared_ptr<Events_Message> aMsg(
319 new Events_Message(Events_Loop::eventByName(EVENT_DOCUMENT_CHANGED)));
320 Events_Loop::loop()->send(aMsg);
322 // make the current state correct and synchronized in the module and sub-documents
323 if (isOperation()) { // do it only in transaction, not on opening of document
324 if (myCurrentDoc == moduleDocument()) {
325 // make the current feature the latest in root, in previous root current become also last
326 makeCurrentLast(aPrevious);
327 makeCurrentLast(myCurrentDoc);
329 // make the current feature the latest in sub, root current feature becomes this sub
330 makeCurrentLast(myCurrentDoc);
336 std::list<std::shared_ptr<ModelAPI_Document> > Model_Session::allOpenedDocuments()
338 std::list<std::shared_ptr<ModelAPI_Document> > aResult;
339 aResult.push_back(moduleDocument());
340 // add subs recursively
341 std::list<std::shared_ptr<ModelAPI_Document> >::iterator aDoc = aResult.begin();
342 for(; aDoc != aResult.end(); aDoc++) {
343 DocumentPtr anAPIDoc = *aDoc;
344 std::shared_ptr<Model_Document> aDoc = std::dynamic_pointer_cast<Model_Document>(anAPIDoc);
346 const std::set<int> aSubs = aDoc->subDocuments();
347 std::set<int>::const_iterator aSubIter = aSubs.cbegin();
348 for(; aSubIter != aSubs.cend(); aSubIter++) {
349 aResult.push_back(Model_Application::getApplication()->document(*aSubIter));
356 bool Model_Session::isLoadByDemand(const std::string theDocID, const int theDocIndex)
358 return Model_Application::getApplication()->isLoadByDemand(theDocID, theDocIndex);
361 std::shared_ptr<ModelAPI_Document> Model_Session::copy(
362 std::shared_ptr<ModelAPI_Document> theSource, const int theDestID)
364 std::shared_ptr<Model_Document> aNew = Model_Application::getApplication()->document(theDestID);
365 // make a copy of all labels
366 TDF_Label aSourceRoot = std::dynamic_pointer_cast<Model_Document>(theSource)->document()->Main()
368 TDF_Label aTargetRoot = aNew->document()->Main().Father();
369 Handle(TDF_DataSet) aDS = new TDF_DataSet;
370 aDS->AddLabel(aSourceRoot);
371 TDF_ClosureTool::Closure(aDS);
372 Handle(TDF_RelocationTable) aRT = new TDF_RelocationTable(Standard_True);
373 aRT->SetRelocation(aSourceRoot, aTargetRoot);
374 TDF_CopyTool::Copy(aDS, aRT);
376 // TODO: remove after fix in OCCT.
377 // All named shapes are stored in reversed order, so to fix this we reverse them back.
378 for(TDF_ChildIDIterator aChildIter(aTargetRoot, TNaming_NamedShape::GetID(), true);
381 Handle(TNaming_NamedShape) aNamedShape =
382 Handle(TNaming_NamedShape)::DownCast(aChildIter.Value());
383 if (aNamedShape.IsNull()) {
387 TopoDS_Shape aShape = aNamedShape->Get();
388 if(aShape.IsNull() || aShape.ShapeType() != TopAbs_COMPOUND) {
392 TNaming_Evolution anEvol = aNamedShape->Evolution();
393 std::list<std::pair<TopoDS_Shape, TopoDS_Shape> > aShapePairs; // to store old and new shapes
394 for(TNaming_Iterator anIter(aNamedShape); anIter.More(); anIter.Next()) {
395 aShapePairs.push_back(
396 std::pair<TopoDS_Shape, TopoDS_Shape>(anIter.OldShape(), anIter.NewShape()));
399 // Add in reverse order.
400 TDF_Label aLabel = aNamedShape->Label();
401 TNaming_Builder aBuilder(aLabel);
402 for(std::list<std::pair<TopoDS_Shape, TopoDS_Shape> >::iterator aPairsIter =
404 aPairsIter != aShapePairs.end();
406 if (anEvol == TNaming_GENERATED) {
407 aBuilder.Generated(aPairsIter->first, aPairsIter->second);
408 } else if (anEvol == TNaming_MODIFY) {
409 aBuilder.Modify(aPairsIter->first, aPairsIter->second);
410 } else if (anEvol == TNaming_DELETE) {
411 aBuilder.Delete(aPairsIter->first);
412 } else if (anEvol == TNaming_PRIMITIVE) {
413 aBuilder.Generated(aPairsIter->second);
414 } else if (anEvol == TNaming_SELECTED) {
415 aBuilder.Select(aPairsIter->second, aPairsIter->first);
420 TDF_LabelList anEmptyUpdated;
421 aNew->objects()->synchronizeFeatures(anEmptyUpdated, true, true, true, true);
425 Model_Session::Model_Session()
427 myPluginsInfoLoaded = false;
428 myCheckTransactions = true;
429 myOperationAttachedToNext = false;
430 ModelAPI_Session::setSession(std::shared_ptr<ModelAPI_Session>(this));
431 // register the configuration reading listener
432 Events_Loop* aLoop = Events_Loop::loop();
433 static const Events_ID kFeatureEvent =
434 Events_Loop::eventByName(Config_FeatureMessage::MODEL_EVENT());
435 aLoop->registerListener(this, kFeatureEvent);
436 aLoop->registerListener(this, Events_Loop::eventByName(EVENT_OBJECT_CREATED), 0, true);
437 aLoop->registerListener(this, Events_Loop::eventByName(EVENT_OBJECT_UPDATED), 0, true);
438 aLoop->registerListener(this, Events_Loop::eventByName(EVENT_OBJECT_DELETED), 0, true);
439 aLoop->registerListener(this, Events_Loop::eventByName(EVENT_VALIDATOR_LOADED));
440 aLoop->registerListener(this, Events_Loop::eventByName(Config_PluginMessage::EVENT_ID()));
443 void Model_Session::processEvent(const std::shared_ptr<Events_Message>& theMessage)
445 static const Events_ID kFeatureEvent =
446 Events_Loop::eventByName(Config_FeatureMessage::MODEL_EVENT());
447 static const Events_ID kValidatorEvent = Events_Loop::eventByName(EVENT_VALIDATOR_LOADED);
448 static const Events_ID kPluginEvent = Events_Loop::eventByName(Config_PluginMessage::EVENT_ID());
449 if (theMessage->eventID() == kFeatureEvent) {
450 const std::shared_ptr<Config_FeatureMessage> aMsg =
451 std::dynamic_pointer_cast<Config_FeatureMessage>(theMessage);
454 // process the plugin info, load plugin
455 if (myPlugins.find(aMsg->id()) == myPlugins.end()) {
456 myPlugins[aMsg->id()] = std::pair<std::string, std::string>(
457 aMsg->pluginLibrary(), aMsg->documentKind());
460 const std::shared_ptr<Config_AttributeMessage> aMsgAttr =
461 std::dynamic_pointer_cast<Config_AttributeMessage>(theMessage);
464 if (!aMsgAttr->isObligatory()) {
465 validators()->registerNotObligatory(aMsgAttr->featureId(), aMsgAttr->attributeId());
467 if(aMsgAttr->isConcealment()) {
468 validators()->registerConcealment(aMsgAttr->featureId(), aMsgAttr->attributeId());
470 if(aMsgAttr->isMainArgument()) {
471 validators()->registerMainArgument(aMsgAttr->featureId(), aMsgAttr->attributeId());
473 const std::list<std::pair<std::string, std::string> >& aCases = aMsgAttr->getCases();
474 if (!aCases.empty()) {
475 validators()->registerCase(aMsgAttr->featureId(), aMsgAttr->attributeId(), aCases);
477 if (aMsgAttr->isGeometricalSelection()) {
478 validators()->registerGeometricalSelection(aMsgAttr->featureId(),
479 aMsgAttr->attributeId());
483 // plugins information was started to load, so, it will be loaded
484 myPluginsInfoLoaded = true;
485 } else if (theMessage->eventID() == kValidatorEvent) {
486 std::shared_ptr<Config_ValidatorMessage> aMsg =
487 std::dynamic_pointer_cast<Config_ValidatorMessage>(theMessage);
489 if (aMsg->attributeId().empty()) { // feature validator
490 validators()->assignValidator(aMsg->validatorId(), aMsg->featureId(), aMsg->parameters());
491 } else { // attribute validator
492 validators()->assignValidator(aMsg->validatorId(), aMsg->featureId(), aMsg->attributeId(),
496 } else if (theMessage->eventID() == kPluginEvent) { // plugin is started to load
497 std::shared_ptr<Config_PluginMessage> aMsg =
498 std::dynamic_pointer_cast<Config_PluginMessage>(theMessage);
500 myCurrentPluginName = aMsg->pluginId();
501 if (!aMsg->uses().empty()) {
502 myUsePlugins[myCurrentPluginName] = aMsg->uses();
505 } else { // create/update/delete
506 if (myCheckTransactions && !isOperation())
507 Events_InfoMessage("Model_Session",
508 "Modification of data structure outside of the transaction").send();
509 // if part is deleted, make the root as the current document (on undo of Parts creations)
510 static const Events_ID kDeletedEvent = Events_Loop::eventByName(EVENT_OBJECT_DELETED);
511 if (theMessage->eventID() == kDeletedEvent) {
512 std::shared_ptr<ModelAPI_ObjectDeletedMessage> aDeleted =
513 std::dynamic_pointer_cast<ModelAPI_ObjectDeletedMessage>(theMessage);
515 std::list<std::pair<std::shared_ptr<ModelAPI_Document>, std::string>>::const_iterator
516 aGIter = aDeleted->groups().cbegin();
517 for (; aGIter != aDeleted->groups().cend(); aGIter++) {
518 if (aGIter->second == ModelAPI_ResultPart::group())
521 if (aGIter != aDeleted->groups().cend())
523 // check that the current feature of the session is still the active Part (even disabled)
525 FeaturePtr aCurrentPart = moduleDocument()->currentFeature(true);
526 if (aCurrentPart.get()) {
527 const std::list<std::shared_ptr<ModelAPI_Result> >& aResList = aCurrentPart->results();
528 std::list<std::shared_ptr<ModelAPI_Result> >::const_iterator aRes = aResList.begin();
529 for(; !aFound && aRes != aResList.end(); aRes++) {
530 ResultPartPtr aPRes = std::dynamic_pointer_cast<ModelAPI_ResultPart>(*aRes);
531 if (aPRes.get() && aPRes->isActivated() && aPRes->partDoc() == activeDocument()) {
537 if (!aFound) { // if not, the part was removed, so activate the module document
538 if (myCurrentDoc.get())
539 setActiveDocument(moduleDocument());
546 void Model_Session::LoadPluginsInfo()
548 if (myPluginsInfoLoaded) // nothing to do
550 // Read plugins information from XML files
551 Config_ModuleReader aModuleReader(Config_FeatureMessage::MODEL_EVENT());
552 aModuleReader.readAll();
553 std::set<std::string> aFiles = aModuleReader.modulePluginFiles();
554 std::set<std::string>::iterator it = aFiles.begin();
555 for ( ; it != aFiles.end(); it++ ) {
556 Config_ValidatorReader aValidatorReader (*it);
557 aValidatorReader.readAll();
562 void Model_Session::registerPlugin(ModelAPI_Plugin* thePlugin)
564 myPluginObjs[myCurrentPluginName] = thePlugin;
565 static Events_ID EVENT_LOAD = Events_Loop::loop()->eventByName(EVENT_PLUGIN_LOADED);
566 ModelAPI_EventCreator::get()->sendUpdated(ObjectPtr(), EVENT_LOAD, false);
567 // If the plugin has an ability to process GUI events, register it
568 Events_Listener* aListener = dynamic_cast<Events_Listener*>(thePlugin);
570 Events_Loop* aLoop = Events_Loop::loop();
571 static Events_ID aStateRequestEventId =
572 Events_Loop::loop()->eventByName(EVENT_FEATURE_STATE_REQUEST);
573 aLoop->registerListener(aListener, aStateRequestEventId);
577 ModelAPI_ValidatorsFactory* Model_Session::validators()
579 static Model_ValidatorsFactory* aFactory = new Model_ValidatorsFactory;
583 int Model_Session::transactionID()
585 return ROOT_DOC->transactionID();
588 bool Model_Session::isAutoUpdateBlocked()
590 Handle(Model_Application) anApp = Model_Application::getApplication();
591 if (!anApp->hasRoot()) // when document is not yet created, do not create it by such simple call
593 return !ROOT_DOC->autoRecomutationState();
596 void Model_Session::blockAutoUpdate(const bool theBlock)
598 bool aCurrentState = isAutoUpdateBlocked();
599 if (aCurrentState != theBlock) {
600 // if there is no operation, start it to avoid modifications outside of transaction
601 bool isOperation = this->isOperation();
603 startOperation("Auto update");
604 ROOT_DOC->setAutoRecomutationState(!theBlock);
605 static Events_Loop* aLoop = Events_Loop::loop();
607 static const Events_ID kAutoOff = aLoop->eventByName(EVENT_AUTOMATIC_RECOMPUTATION_DISABLE);
608 std::shared_ptr<Events_Message> aMsg(new Events_Message(kAutoOff));
611 // if there is no operation, start it to avoid modifications outside of transaction
612 bool isOperation = this->isOperation();
614 startOperation("Auto update enabling");
615 static const Events_ID kAutoOn = aLoop->eventByName(EVENT_AUTOMATIC_RECOMPUTATION_ENABLE);
616 std::shared_ptr<Events_Message> aMsg(new Events_Message(kAutoOn));
621 // append this transaction to the previous one: don't need this separated operation in list
622 ROOT_DOC->appendTransactionToPrevious();