From f425c2070131161dc11bcf70e35f8d1848cadb65 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Tue, 6 Dec 2016 19:40:33 +0100 Subject: Interresourcemovetest/fixed interresourcemove We cant take the identifier from the entity where we just cleared the identifier. --- common/pipeline.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'common/pipeline.cpp') diff --git a/common/pipeline.cpp b/common/pipeline.cpp index 4ea43eb..7ee4b91 100644 --- a/common/pipeline.cpp +++ b/common/pipeline.cpp @@ -277,22 +277,22 @@ KAsync::Job Pipeline::modifiedEntity(void const *command, size_t size) SinkTrace() << "Moving entity to new resource " << newEntity.identifier() << newEntity.resourceInstanceIdentifier() << targetResource; auto job = TypeHelper{bufferType}.operator(), ApplicationDomain::ApplicationDomainType&>(newEntity); - job = job.syncThen([this, newEntity, isMove, targetResource, bufferType](const KAsync::Error &error) { + job = job.syncThen([this, current, isMove, targetResource, bufferType](const KAsync::Error &error) { if (!error) { - SinkTrace() << "Move of " << newEntity.identifier() << "was successfull"; + SinkTrace() << "Move of " << current.identifier() << "was successfull"; if (isMove) { startTransaction(); flatbuffers::FlatBufferBuilder fbb; - auto entityId = fbb.CreateString(newEntity.identifier()); + auto entityId = fbb.CreateString(current.identifier()); auto type = fbb.CreateString(bufferType); - auto location = Sink::Commands::CreateDeleteEntity(fbb, newEntity.revision(), entityId, type, true); + auto location = Sink::Commands::CreateDeleteEntity(fbb, current.revision(), entityId, type, true); Sink::Commands::FinishDeleteEntityBuffer(fbb, location); const auto data = BufferUtils::extractBuffer(fbb); deletedEntity(data, data.size()).exec(); commit(); } } else { - SinkError() << "Failed to move entity " << targetResource << " to resource " << newEntity.identifier(); + SinkError() << "Failed to move entity " << targetResource << " to resource " << current.identifier(); } }); job.exec(); -- cgit v1.2.3