Model_Application::getApplication()->deleteAllDocuments();
}
-void Model_Session::startOperation()
+void Model_Session::startOperation(const std::string& theId)
{
ROOT_DOC->startOperation();
+ ROOT_DOC->operationId(theId);
static std::shared_ptr<Events_Message> aStartedMsg
(new Events_Message(Events_Loop::eventByName("StartOperation")));
Events_Loop::loop()->send(aStartedMsg);
setCheckTransactions(true);
}
+//! Returns stack of performed operations
+std::list<std::string> Model_Session::undoList()
+{
+ return ROOT_DOC->undoList();
+}
+//! Returns stack of rolled back operations
+std::list<std::string> Model_Session::redoList()
+{
+ return ROOT_DOC->redoList();
+}
+
FeaturePtr Model_Session::createFeature(string theFeatureID)
{
if (this != myImpl) {
std::shared_ptr<ModelAPI_Document> Model_Session::moduleDocument()
{
- return std::shared_ptr<ModelAPI_Document>(
+ bool aFirstCall = !Model_Application::getApplication()->hasDocument("root");
+ if (aFirstCall) {
+ // creation of the root document is always outside of the transaction, so, avoid checking it
+ setCheckTransactions(false);
+ }
+ std::shared_ptr<ModelAPI_Document> aDoc = std::shared_ptr<ModelAPI_Document>(
Model_Application::getApplication()->getDocument("root"));
+ if (aFirstCall) {
+ // creation of the root document is always outside of the transaction, so, avoid checking it
+ setCheckTransactions(true);
+ }
+ return aDoc;
}
std::shared_ptr<ModelAPI_Document> Model_Session::document(std::string theDocID)
if(aMsgAttr->isConcealment()) {
validators()->registerConcealment(aMsgAttr->featureId(), aMsgAttr->attributeId());
}
-
+ if (!aMsgAttr->caseId().empty()) {
+ validators()->registerCase(aMsgAttr->featureId(), aMsgAttr->attributeId(),
+ aMsgAttr->switchId(), aMsgAttr->caseId());
+ }
}
}
// plugins information was started to load, so, it will be loaded