TaskTree: Rename workflow policies

Make naming consistent with recent changes.
"Done" is meant to be an event name when the task / group
finishes. "Done" may finish with "Success" or an "Error".

This addresses the 26th point in the master task below.

Task-number: QTCREATORBUG-28741
Change-Id: Icc882710dc4896626dc9332440aa13a692af54c4
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
Jarek Kobus
2023-11-04 12:44:19 +01:00
parent 273518c82f
commit 2c0a59384c
19 changed files with 133 additions and 133 deletions

View File

@@ -234,7 +234,7 @@ private:
\code
const Group group {
finishAllAndDone,
finishAllAndSuccess,
NetworkQueryTask(...),
Group {
NetworkQueryTask(...),
@@ -311,7 +311,7 @@ private:
\code
const Group group {
finishAllAndDone,
finishAllAndSuccess,
NetworkQueryTask(...),
Group {
NetworkQueryTask(...),
@@ -484,14 +484,14 @@ private:
afterwards, even when some other tasks in the group finished with success.
If all child tasks finish successfully, the group finishes with success.
If a group is empty, it finishes with success.
\value StopOnDone
Corresponds to the stopOnDone global element.
\value StopOnSuccess
Corresponds to the stopOnSuccess global element.
If any child task finishes with success, the group stops and finishes with success.
If all child tasks finished with an error, the group finishes with an error.
If a group is empty, it finishes with an error.
\value ContinueOnDone
Corresponds to the continueOnDone global element.
Similar to stopOnDone, but in case any child finishes successfully,
\value ContinueOnSuccess
Corresponds to the continueOnSuccess global element.
Similar to stopOnSuccess, but in case any child finishes successfully,
the execution continues until all tasks finish, and the group reports success
afterwards, even when some other tasks in the group finished with an error.
If all child tasks finish with an error, the group finishes with an error.
@@ -504,8 +504,8 @@ private:
In sequential mode, only the first task is started, and when finished,
the group finishes too, so the other tasks are always skipped.
If a group is empty, it finishes with an error.
\value FinishAllAndDone
Corresponds to the finishAllAndDone global element.
\value FinishAllAndSuccess
Corresponds to the finishAllAndSuccess global element.
The group executes all tasks and ignores their return results. When all
tasks finished, the group finishes with success.
If a group is empty, it finishes with success.
@@ -516,7 +516,7 @@ private:
If a group is empty, it finishes with an error.
Whenever a child task's result causes the Group to stop,
i.e. in case of StopOnError, StopOnDone, or StopOnFinished policies,
i.e. in case of StopOnError, StopOnSuccess, or StopOnFinished policies,
the Group stops the other running child tasks (if any - for example in parallel mode),
and skips executing tasks it has not started yet (for example, in the sequential mode -
those, that are placed after the failed task). Both stopping and skipping child tasks
@@ -541,12 +541,12 @@ private:
\li An error when at least one child task failed, success otherwise
\li Success
\row
\li StopOnDone
\li StopOnSuccess
\li Stops when any child task finished with success and reports success
\li Success when at least one child task succeeded, an error otherwise
\li An error
\row
\li ContinueOnDone
\li ContinueOnSuccess
\li Yes
\li Success when at least one child task succeeded, an error otherwise
\li An error
@@ -556,7 +556,7 @@ private:
\li Success or an error, depending on the finished child task's result
\li An error
\row
\li FinishAllAndDone
\li FinishAllAndSuccess
\li Yes
\li Success
\li Success
@@ -569,7 +569,7 @@ private:
If a child of a group is also a group, the child group runs its tasks according to its own
workflow policy. When a parent group stops the running child group because
of parent group's workflow policy, i.e. when the StopOnError, StopOnDone, or StopOnFinished
of parent group's workflow policy, i.e. when the StopOnError, StopOnSuccess, or StopOnFinished
policy was used for the parent, the child group's result is reported according to the
\b Result column and to the \b {child group's workflow policy} row in the table above.
*/
@@ -613,13 +613,13 @@ private:
*/
/*!
\variable stopOnDone
A convenient global group's element describing the StopOnDone workflow policy.
\variable stopOnSuccess
A convenient global group's element describing the StopOnSuccess workflow policy.
*/
/*!
\variable continueOnDone
A convenient global group's element describing the ContinueOnDone workflow policy.
\variable continueOnSuccess
A convenient global group's element describing the ContinueOnSuccess workflow policy.
*/
/*!
@@ -628,8 +628,8 @@ private:
*/
/*!
\variable finishAllAndDone
A convenient global group's element describing the FinishAllAndDone workflow policy.
\variable finishAllAndSuccess
A convenient global group's element describing the FinishAllAndSuccess workflow policy.
*/
/*!
@@ -734,7 +734,7 @@ private:
Constructs a group's element holding the group done handler.
The \a handler is invoked whenever the group finishes with success.
Depending on the group's workflow policy, this handler may also be called
when the running group is stopped (e.g. when finishAllAndDone element was used).
when the running group is stopped (e.g. when finishAllAndSuccess element was used).
When the \a handler is invoked, all of the group's child tasks are already finished.
@@ -813,8 +813,8 @@ GroupItem parallelLimit(int limit)
For convenience, global elements may be used instead.
\sa stopOnError, continueOnError, stopOnDone, continueOnDone, stopOnFinished, finishAllAndDone,
finishAllAndError, WorkflowPolicy
\sa stopOnError, continueOnError, stopOnSuccess, continueOnSuccess, stopOnFinished,
finishAllAndSuccess, finishAllAndError, WorkflowPolicy
*/
GroupItem workflowPolicy(WorkflowPolicy policy)
{
@@ -826,10 +826,10 @@ const GroupItem parallel = parallelLimit(0);
const GroupItem stopOnError = workflowPolicy(WorkflowPolicy::StopOnError);
const GroupItem continueOnError = workflowPolicy(WorkflowPolicy::ContinueOnError);
const GroupItem stopOnDone = workflowPolicy(WorkflowPolicy::StopOnDone);
const GroupItem continueOnDone = workflowPolicy(WorkflowPolicy::ContinueOnDone);
const GroupItem stopOnSuccess = workflowPolicy(WorkflowPolicy::StopOnSuccess);
const GroupItem continueOnSuccess = workflowPolicy(WorkflowPolicy::ContinueOnSuccess);
const GroupItem stopOnFinished = workflowPolicy(WorkflowPolicy::StopOnFinished);
const GroupItem finishAllAndDone = workflowPolicy(WorkflowPolicy::FinishAllAndDone);
const GroupItem finishAllAndSuccess = workflowPolicy(WorkflowPolicy::FinishAllAndSuccess);
const GroupItem finishAllAndError = workflowPolicy(WorkflowPolicy::FinishAllAndError);
static SetupResult toSetupResult(bool success)
@@ -1251,10 +1251,10 @@ static bool initialSuccessBit(WorkflowPolicy workflowPolicy)
switch (workflowPolicy) {
case WorkflowPolicy::StopOnError:
case WorkflowPolicy::ContinueOnError:
case WorkflowPolicy::FinishAllAndDone:
case WorkflowPolicy::FinishAllAndSuccess:
return true;
case WorkflowPolicy::StopOnDone:
case WorkflowPolicy::ContinueOnDone:
case WorkflowPolicy::StopOnSuccess:
case WorkflowPolicy::ContinueOnSuccess:
case WorkflowPolicy::StopOnFinished:
case WorkflowPolicy::FinishAllAndError:
return false;
@@ -1280,7 +1280,7 @@ TaskContainer::RuntimeData::~RuntimeData()
bool TaskContainer::RuntimeData::updateSuccessBit(bool success)
{
if (m_constData.m_workflowPolicy == WorkflowPolicy::FinishAllAndDone
if (m_constData.m_workflowPolicy == WorkflowPolicy::FinishAllAndSuccess
|| m_constData.m_workflowPolicy == WorkflowPolicy::FinishAllAndError
|| m_constData.m_workflowPolicy == WorkflowPolicy::StopOnFinished) {
if (m_constData.m_workflowPolicy == WorkflowPolicy::StopOnFinished)
@@ -1288,8 +1288,8 @@ bool TaskContainer::RuntimeData::updateSuccessBit(bool success)
return m_successBit;
}
const bool donePolicy = m_constData.m_workflowPolicy == WorkflowPolicy::StopOnDone
|| m_constData.m_workflowPolicy == WorkflowPolicy::ContinueOnDone;
const bool donePolicy = m_constData.m_workflowPolicy == WorkflowPolicy::StopOnSuccess
|| m_constData.m_workflowPolicy == WorkflowPolicy::ContinueOnSuccess;
m_successBit = donePolicy ? (m_successBit || success) : (m_successBit && success);
return m_successBit;
}
@@ -1373,7 +1373,7 @@ SetupResult TaskContainer::childDone(bool success)
QTC_CHECK(isRunning());
const int limit = m_runtimeData->currentLimit(); // Read before bumping m_doneCount and stop()
const bool shouldStop = m_constData.m_workflowPolicy == WorkflowPolicy::StopOnFinished
|| (m_constData.m_workflowPolicy == WorkflowPolicy::StopOnDone && success)
|| (m_constData.m_workflowPolicy == WorkflowPolicy::StopOnSuccess && success)
|| (m_constData.m_workflowPolicy == WorkflowPolicy::StopOnError && !success);
if (shouldStop)
stop();

View File

@@ -101,26 +101,26 @@ private:
};
// WorkflowPolicy:
// 1. When all children finished with done -> report done, otherwise:
// 1. When all children finished with success -> report success, otherwise:
// a) Report error on first error and stop executing other children (including their subtree).
// b) On first error - continue executing all children and report error afterwards.
// 2. When all children finished with error -> report error, otherwise:
// a) Report done on first done and stop executing other children (including their subtree).
// b) On first done - continue executing all children and report done afterwards.
// a) Report success on first success and stop executing other children (including their subtree).
// b) On first success - continue executing all children and report success afterwards.
// 3. Stops on first finished child. In sequential mode it will never run other children then the first one.
// Useful only in parallel mode.
// 4. Always run all children, let them finish, ignore their results and report done afterwards.
// 4. Always run all children, let them finish, ignore their results and report success afterwards.
// 5. Always run all children, let them finish, ignore their results and report error afterwards.
enum class WorkflowPolicy
{
StopOnError, // 1a - Reports error on first child error, otherwise done (if all children were done).
ContinueOnError, // 1b - The same, but children execution continues. Reports done when no children.
StopOnDone, // 2a - Reports done on first child done, otherwise error (if all children were error).
ContinueOnDone, // 2b - The same, but children execution continues. Reports error when no children.
StopOnFinished, // 3 - Stops on first finished child and report its result.
FinishAllAndDone, // 4 - Reports done after all children finished.
FinishAllAndError // 5 - Reports error after all children finished.
StopOnError, // 1a - Reports error on first child error, otherwise success (if all children were success).
ContinueOnError, // 1b - The same, but children execution continues. Reports success when no children.
StopOnSuccess, // 2a - Reports success on first child success, otherwise error (if all children were error).
ContinueOnSuccess, // 2b - The same, but children execution continues. Reports error when no children.
StopOnFinished, // 3 - Stops on first finished child and report its result.
FinishAllAndSuccess, // 4 - Reports success after all children finished.
FinishAllAndError // 5 - Reports error after all children finished.
};
Q_ENUM_NS(WorkflowPolicy);
@@ -322,10 +322,10 @@ TASKING_EXPORT extern const GroupItem parallel;
TASKING_EXPORT extern const GroupItem stopOnError;
TASKING_EXPORT extern const GroupItem continueOnError;
TASKING_EXPORT extern const GroupItem stopOnDone;
TASKING_EXPORT extern const GroupItem continueOnDone;
TASKING_EXPORT extern const GroupItem stopOnSuccess;
TASKING_EXPORT extern const GroupItem continueOnSuccess;
TASKING_EXPORT extern const GroupItem stopOnFinished;
TASKING_EXPORT extern const GroupItem finishAllAndDone;
TASKING_EXPORT extern const GroupItem finishAllAndSuccess;
TASKING_EXPORT extern const GroupItem finishAllAndError;
class TASKING_EXPORT Storage final : public GroupItem

View File

@@ -347,7 +347,7 @@ void TestRunner::runTestsHelper()
std::unique_ptr<TestOutputReader> m_outputReader;
};
QList<GroupItem> tasks{finishAllAndDone};
QList<GroupItem> tasks{finishAllAndSuccess};
for (ITestConfiguration *config : m_selectedTests) {
QTC_ASSERT(config, continue);
@@ -445,7 +445,7 @@ void TestRunner::runTestsHelper()
}
};
const Group group {
finishAllAndDone,
finishAllAndSuccess,
Tasking::Storage(storage),
onGroupSetup(onSetup),
ProcessTask(onProcessSetup, onProcessDone)

View File

@@ -218,7 +218,7 @@ GroupItem clangToolTask(const AnalyzeInputData &input,
};
const Group group {
finishAllAndDone,
finishAllAndSuccess,
Tasking::Storage(storage),
onGroupSetup(onSetup),
Group {

View File

@@ -215,7 +215,7 @@ void DocumentClangToolRunner::run()
return !m_document->isModified() || isVFSOverlaySupported(executable);
};
const auto outputHandler = [this](const AnalyzeOutputData &output) { onDone(output); };
tasks.append(Group{finishAllAndDone, clangToolTask(input, setupHandler, outputHandler)});
tasks.append(Group{finishAllAndSuccess, clangToolTask(input, setupHandler, outputHandler)});
};
addClangTool(ClangToolType::Tidy);
addClangTool(ClangToolType::Clazy);

View File

@@ -370,7 +370,7 @@ GroupItem CMakeBuildStep::runRecipe()
OutputFormat::ErrorMessage);
};
Group root {
ignoreReturnValue() ? finishAllAndDone : stopOnError,
ignoreReturnValue() ? finishAllAndSuccess : stopOnError,
ProjectParserTask(onParserSetup, onParserError, CallDoneIf::Error),
defaultProcessTask(),
onGroupDone([this] { updateDeploymentData(); })

View File

@@ -461,7 +461,7 @@ void LocatorMatcher::start()
for (const LocatorMatcherTask &task : std::as_const(d->m_tasks)) {
const auto storage = task.storage;
const Group group {
finishAllAndDone,
finishAllAndSuccess,
Storage(storage),
onGroupSetup(onSetup(storage, index)),
onGroupDone([storage] { storage->finalize(); }),

View File

@@ -388,7 +388,7 @@ void Locator::refresh(const QList<ILocatorFilter *> &filters)
continue;
const Group group {
finishAllAndDone,
finishAllAndSuccess,
*task,
onGroupDone([this, filter] { m_refreshingFilters.removeOne(filter); }, CallDoneIf::Success)
};

View File

@@ -116,7 +116,7 @@ DiffFilesController::DiffFilesController(IDocument *document)
const QList<ReloadInput> inputList = reloadInputList();
outputList->resize(inputList.size());
QList<GroupItem> tasks { parallel, finishAllAndDone };
QList<GroupItem> tasks { parallel, finishAllAndSuccess };
for (int i = 0; i < inputList.size(); ++i) {
const auto onDiffSetup = [this, reloadInput = inputList.at(i)](Async<FileData> &async) {
async.setConcurrentCallData(

View File

@@ -337,7 +337,7 @@ FileListDiffController::FileListDiffController(IDocument *document, const QStrin
Tasking::Storage(diffInputStorage),
Group {
parallel,
continueOnDone,
continueOnSuccess,
ProcessTask(onStagedSetup, onStagedDone, CallDoneIf::Success),
ProcessTask(onUnstagedSetup, onUnstagedDone, CallDoneIf::Success),
onGroupDone(onDone, CallDoneIf::Success)
@@ -500,7 +500,7 @@ ShowController::ShowController(IDocument *document, const QString &id)
QList<GroupItem> tasks {
parallel,
continueOnDone,
continueOnSuccess,
onGroupDone(onFollowsError, CallDoneIf::Error)
};
for (int i = 0, total = parents.size(); i < total; ++i) {
@@ -532,11 +532,11 @@ ShowController::ShowController(IDocument *document, const QString &id)
parallel,
onGroupSetup([this] { setStartupFile(VcsBase::source(this->document()).toString()); }),
Group {
finishAllAndDone,
finishAllAndSuccess,
ProcessTask(onDescriptionSetup, onDescriptionDone, CallDoneIf::Success),
Group {
parallel,
finishAllAndDone,
finishAllAndSuccess,
onGroupSetup(desciptionDetailsSetup),
ProcessTask(onBranchesSetup, onBranchesDone, CallDoneIf::Success),
ProcessTask(onPrecedesSetup, onPrecedesDone, CallDoneIf::Success),

View File

@@ -283,7 +283,7 @@ void AbstractProcessStep::setDisplayedParameters(ProcessParameters *params)
GroupItem AbstractProcessStep::runRecipe()
{
return Group { ignoreReturnValue() ? finishAllAndDone : stopOnError, defaultProcessTask() };
return Group { ignoreReturnValue() ? finishAllAndSuccess : stopOnError, defaultProcessTask() };
}
} // namespace ProjectExplorer

View File

@@ -227,7 +227,7 @@ Tasking::GroupItem QmakeMakeStep::runRecipe()
};
return Group {
ignoreReturnValue() ? finishAllAndDone : stopOnError,
ignoreReturnValue() ? finishAllAndSuccess : stopOnError,
onGroupSetup(onSetup),
onGroupDone(onError, CallDoneIf::Error),
defaultProcessTask()

View File

@@ -223,7 +223,7 @@ GroupItem QnxDeployQtLibrariesDialogPrivate::chmodTree()
if (file.isExecutable())
filesToChmod << file;
}
QList<GroupItem> chmodList{finishAllAndDone, parallelLimit(MaxConcurrentStatCalls)};
QList<GroupItem> chmodList{finishAllAndSuccess, parallelLimit(MaxConcurrentStatCalls)};
for (const DeployableFile &file : std::as_const(filesToChmod)) {
QTC_ASSERT(file.isValid(), continue);
chmodList.append(chmodTask(file));
@@ -263,7 +263,7 @@ Group QnxDeployQtLibrariesDialogPrivate::deployRecipe()
const Group root {
onGroupSetup(setupHandler),
Group {
finishAllAndDone,
finishAllAndSuccess,
checkDirTask()
},
Group {

View File

@@ -154,7 +154,7 @@ GroupItem GenericDirectUploadStep::statTree(const TreeStorage<UploadStorage> &st
const auto onSetup = [this, storage, filesToStat, statEndHandler](TaskTree &tree) {
UploadStorage *storagePtr = storage.activeStorage();
const QList<DeployableFile> files = filesToStat(storagePtr);
QList<GroupItem> statList{finishAllAndDone, parallelLimit(MaxConcurrentStatCalls)};
QList<GroupItem> statList{finishAllAndSuccess, parallelLimit(MaxConcurrentStatCalls)};
for (const DeployableFile &file : std::as_const(files)) {
QTC_ASSERT(file.isValid(), continue);
statList.append(statTask(storagePtr, file, statEndHandler));
@@ -231,7 +231,7 @@ GroupItem GenericDirectUploadStep::chmodTree(const TreeStorage<UploadStorage> &s
if (file.isExecutable())
filesToChmod << file;
}
QList<GroupItem> chmodList{finishAllAndDone, parallelLimit(MaxConcurrentStatCalls)};
QList<GroupItem> chmodList{finishAllAndSuccess, parallelLimit(MaxConcurrentStatCalls)};
for (const DeployableFile &file : std::as_const(filesToChmod)) {
QTC_ASSERT(file.isValid(), continue);
chmodList.append(chmodTask(file));

View File

@@ -135,7 +135,7 @@ GroupItem GenericLinuxDeviceTesterPrivate::unameTask() const
emit q->errorMessage(Tr::tr("uname failed.") + '\n');
};
return Group {
finishAllAndDone,
finishAllAndSuccess,
ProcessTask(onSetup, onDone)
};
}
@@ -162,7 +162,7 @@ GroupItem GenericLinuxDeviceTesterPrivate::gathererTask() const
};
return Group {
finishAllAndDone,
finishAllAndSuccess,
DeviceUsedPortsGathererTask(onSetup, onDone)
};
}
@@ -228,7 +228,7 @@ GroupItem GenericLinuxDeviceTesterPrivate::transferTasks() const
{
TreeStorage<TransferStorage> storage;
return Group {
continueOnDone,
continueOnSuccess,
Tasking::Storage(storage),
transferTask(FileTransferMethod::GenericCopy, storage),
transferTask(FileTransferMethod::Sftp, storage),

View File

@@ -201,7 +201,7 @@ SubversionDiffEditorController::SubversionDiffEditorController(IDocument *docume
Tasking::Storage(diffInputStorage),
parallel,
Group {
finishAllAndDone,
finishAllAndSuccess,
ProcessTask(onDescriptionSetup, onDescriptionDone)
},
Group {

View File

@@ -344,18 +344,18 @@ void tst_Tasking::testTree_data()
QTest::newRow("DoneAndStopOnError") << doneData(WorkflowPolicy::StopOnError);
QTest::newRow("DoneAndContinueOnError") << doneData(WorkflowPolicy::ContinueOnError);
QTest::newRow("DoneAndStopOnDone") << doneData(WorkflowPolicy::StopOnDone);
QTest::newRow("DoneAndContinueOnDone") << doneData(WorkflowPolicy::ContinueOnDone);
QTest::newRow("DoneAndStopOnSuccess") << doneData(WorkflowPolicy::StopOnSuccess);
QTest::newRow("DoneAndContinueOnSuccess") << doneData(WorkflowPolicy::ContinueOnSuccess);
QTest::newRow("DoneAndStopOnFinished") << doneData(WorkflowPolicy::StopOnFinished);
QTest::newRow("DoneAndFinishAllAndDone") << doneData(WorkflowPolicy::FinishAllAndDone);
QTest::newRow("DoneAndFinishAllAndSuccess") << doneData(WorkflowPolicy::FinishAllAndSuccess);
QTest::newRow("DoneAndFinishAllAndError") << doneData(WorkflowPolicy::FinishAllAndError);
QTest::newRow("ErrorAndStopOnError") << errorData(WorkflowPolicy::StopOnError);
QTest::newRow("ErrorAndContinueOnError") << errorData(WorkflowPolicy::ContinueOnError);
QTest::newRow("ErrorAndStopOnDone") << errorData(WorkflowPolicy::StopOnDone);
QTest::newRow("ErrorAndContinueOnDone") << errorData(WorkflowPolicy::ContinueOnDone);
QTest::newRow("ErrorAndStopOnSuccess") << errorData(WorkflowPolicy::StopOnSuccess);
QTest::newRow("ErrorAndContinueOnSuccess") << errorData(WorkflowPolicy::ContinueOnSuccess);
QTest::newRow("ErrorAndStopOnFinished") << errorData(WorkflowPolicy::StopOnFinished);
QTest::newRow("ErrorAndFinishAllAndDone") << errorData(WorkflowPolicy::FinishAllAndDone);
QTest::newRow("ErrorAndFinishAllAndSuccess") << errorData(WorkflowPolicy::FinishAllAndSuccess);
QTest::newRow("ErrorAndFinishAllAndError") << errorData(WorkflowPolicy::FinishAllAndError);
}
@@ -681,20 +681,20 @@ void tst_Tasking::testTree_data()
QTest::newRow("EmptyContinueOnError") << TestData{storage, root2, doneLog, 0,
OnDone::Success};
const Group root3 = createRoot(WorkflowPolicy::StopOnDone);
QTest::newRow("EmptyStopOnDone") << TestData{storage, root3, errorLog, 0,
const Group root3 = createRoot(WorkflowPolicy::StopOnSuccess);
QTest::newRow("EmptyStopOnSuccess") << TestData{storage, root3, errorLog, 0,
OnDone::Failure};
const Group root4 = createRoot(WorkflowPolicy::ContinueOnDone);
QTest::newRow("EmptyContinueOnDone") << TestData{storage, root4, errorLog, 0,
const Group root4 = createRoot(WorkflowPolicy::ContinueOnSuccess);
QTest::newRow("EmptyContinueOnSuccess") << TestData{storage, root4, errorLog, 0,
OnDone::Failure};
const Group root5 = createRoot(WorkflowPolicy::StopOnFinished);
QTest::newRow("EmptyStopOnFinished") << TestData{storage, root5, errorLog, 0,
OnDone::Failure};
const Group root6 = createRoot(WorkflowPolicy::FinishAllAndDone);
QTest::newRow("EmptyFinishAllAndDone") << TestData{storage, root6, doneLog, 0,
const Group root6 = createRoot(WorkflowPolicy::FinishAllAndSuccess);
QTest::newRow("EmptyFinishAllAndSuccess") << TestData{storage, root6, doneLog, 0,
OnDone::Success};
const Group root7 = createRoot(WorkflowPolicy::FinishAllAndError);
@@ -733,20 +733,20 @@ void tst_Tasking::testTree_data()
QTest::newRow("DoneContinueOnError") << TestData{storage, root2, doneLog, 1,
OnDone::Success};
const Group root3 = createRoot(WorkflowPolicy::StopOnDone);
QTest::newRow("DoneStopOnDone") << TestData{storage, root3, doneLog, 1,
const Group root3 = createRoot(WorkflowPolicy::StopOnSuccess);
QTest::newRow("DoneStopOnSuccess") << TestData{storage, root3, doneLog, 1,
OnDone::Success};
const Group root4 = createRoot(WorkflowPolicy::ContinueOnDone);
QTest::newRow("DoneContinueOnDone") << TestData{storage, root4, doneLog, 1,
const Group root4 = createRoot(WorkflowPolicy::ContinueOnSuccess);
QTest::newRow("DoneContinueOnSuccess") << TestData{storage, root4, doneLog, 1,
OnDone::Success};
const Group root5 = createRoot(WorkflowPolicy::StopOnFinished);
QTest::newRow("DoneStopOnFinished") << TestData{storage, root5, doneLog, 1,
OnDone::Success};
const Group root6 = createRoot(WorkflowPolicy::FinishAllAndDone);
QTest::newRow("DoneFinishAllAndDone") << TestData{storage, root6, doneLog, 1,
const Group root6 = createRoot(WorkflowPolicy::FinishAllAndSuccess);
QTest::newRow("DoneFinishAllAndSuccess") << TestData{storage, root6, doneLog, 1,
OnDone::Success};
const Group root7 = createRoot(WorkflowPolicy::FinishAllAndError);
@@ -785,20 +785,20 @@ void tst_Tasking::testTree_data()
QTest::newRow("ErrorContinueOnError") << TestData{storage, root2, errorLog, 1,
OnDone::Failure};
const Group root3 = createRoot(WorkflowPolicy::StopOnDone);
QTest::newRow("ErrorStopOnDone") << TestData{storage, root3, errorLog, 1,
const Group root3 = createRoot(WorkflowPolicy::StopOnSuccess);
QTest::newRow("ErrorStopOnSuccess") << TestData{storage, root3, errorLog, 1,
OnDone::Failure};
const Group root4 = createRoot(WorkflowPolicy::ContinueOnDone);
QTest::newRow("ErrorContinueOnDone") << TestData{storage, root4, errorLog, 1,
const Group root4 = createRoot(WorkflowPolicy::ContinueOnSuccess);
QTest::newRow("ErrorContinueOnSuccess") << TestData{storage, root4, errorLog, 1,
OnDone::Failure};
const Group root5 = createRoot(WorkflowPolicy::StopOnFinished);
QTest::newRow("ErrorStopOnFinished") << TestData{storage, root5, errorLog, 1,
OnDone::Failure};
const Group root6 = createRoot(WorkflowPolicy::FinishAllAndDone);
QTest::newRow("ErrorFinishAllAndDone") << TestData{storage, root6, doneLog, 1,
const Group root6 = createRoot(WorkflowPolicy::FinishAllAndSuccess);
QTest::newRow("ErrorFinishAllAndSuccess") << TestData{storage, root6, doneLog, 1,
OnDone::Success};
const Group root7 = createRoot(WorkflowPolicy::FinishAllAndError);
@@ -854,20 +854,20 @@ void tst_Tasking::testTree_data()
QTest::newRow("StopRootWithContinueOnError")
<< TestData{storage, root2, errorDoneLog, 2, OnDone::Failure};
const Group root3 = createRoot(WorkflowPolicy::StopOnDone);
QTest::newRow("StopRootWithStopOnDone")
const Group root3 = createRoot(WorkflowPolicy::StopOnSuccess);
QTest::newRow("StopRootWithStopOnSuccess")
<< TestData{storage, root3, doneLog, 2, OnDone::Success};
const Group root4 = createRoot(WorkflowPolicy::ContinueOnDone);
QTest::newRow("StopRootWithContinueOnDone")
const Group root4 = createRoot(WorkflowPolicy::ContinueOnSuccess);
QTest::newRow("StopRootWithContinueOnSuccess")
<< TestData{storage, root4, doneLog, 2, OnDone::Success};
const Group root5 = createRoot(WorkflowPolicy::StopOnFinished);
QTest::newRow("StopRootWithStopOnFinished")
<< TestData{storage, root5, errorErrorLog, 2, OnDone::Failure};
const Group root6 = createRoot(WorkflowPolicy::FinishAllAndDone);
QTest::newRow("StopRootWithFinishAllAndDone")
const Group root6 = createRoot(WorkflowPolicy::FinishAllAndSuccess);
QTest::newRow("StopRootWithFinishAllAndSuccess")
<< TestData{storage, root6, doneLog, 2, OnDone::Success};
const Group root7 = createRoot(WorkflowPolicy::FinishAllAndError);
@@ -941,20 +941,20 @@ void tst_Tasking::testTree_data()
QTest::newRow("StopRootAfterDoneWithContinueOnError")
<< TestData{storage, root2, errorDoneLog, 3, OnDone::Failure};
const Group root3 = createRoot(WorkflowPolicy::StopOnDone);
QTest::newRow("StopRootAfterDoneWithStopOnDone")
const Group root3 = createRoot(WorkflowPolicy::StopOnSuccess);
QTest::newRow("StopRootAfterDoneWithStopOnSuccess")
<< TestData{storage, root3, doneErrorLog, 3, OnDone::Success};
const Group root4 = createRoot(WorkflowPolicy::ContinueOnDone);
QTest::newRow("StopRootAfterDoneWithContinueOnDone")
const Group root4 = createRoot(WorkflowPolicy::ContinueOnSuccess);
QTest::newRow("StopRootAfterDoneWithContinueOnSuccess")
<< TestData{storage, root4, doneDoneLog, 3, OnDone::Success};
const Group root5 = createRoot(WorkflowPolicy::StopOnFinished);
QTest::newRow("StopRootAfterDoneWithStopOnFinished")
<< TestData{storage, root5, doneErrorLog, 3, OnDone::Success};
const Group root6 = createRoot(WorkflowPolicy::FinishAllAndDone);
QTest::newRow("StopRootAfterDoneWithFinishAllAndDone")
const Group root6 = createRoot(WorkflowPolicy::FinishAllAndSuccess);
QTest::newRow("StopRootAfterDoneWithFinishAllAndSuccess")
<< TestData{storage, root6, doneDoneLog, 3, OnDone::Success};
const Group root7 = createRoot(WorkflowPolicy::FinishAllAndError);
@@ -998,12 +998,12 @@ void tst_Tasking::testTree_data()
QTest::newRow("StopGroupWithContinueOnError")
<< TestData{storage, root2, log, 2, OnDone::Failure};
const Group root3 = createRoot(WorkflowPolicy::StopOnDone);
QTest::newRow("StopGroupWithStopOnDone")
const Group root3 = createRoot(WorkflowPolicy::StopOnSuccess);
QTest::newRow("StopGroupWithStopOnSuccess")
<< TestData{storage, root3, log, 2, OnDone::Failure};
const Group root4 = createRoot(WorkflowPolicy::ContinueOnDone);
QTest::newRow("StopGroupWithContinueOnDone")
const Group root4 = createRoot(WorkflowPolicy::ContinueOnSuccess);
QTest::newRow("StopGroupWithContinueOnSuccess")
<< TestData{storage, root4, log, 2, OnDone::Failure};
const Group root5 = createRoot(WorkflowPolicy::StopOnFinished);
@@ -1011,9 +1011,9 @@ void tst_Tasking::testTree_data()
<< TestData{storage, root5, log, 2, OnDone::Failure};
// TODO: Behavioral change! Fix Docs!
// Cancellation always invokes error handler (i.e. DoneWith is Cancel)
const Group root6 = createRoot(WorkflowPolicy::FinishAllAndDone);
QTest::newRow("StopGroupWithFinishAllAndDone")
// Cancellation always invokes error handler (i.e. DoneWith is Canceled)
const Group root6 = createRoot(WorkflowPolicy::FinishAllAndSuccess);
QTest::newRow("StopGroupWithFinishAllAndSuccess")
<< TestData{storage, root6, log, 2, OnDone::Failure};
const Group root7 = createRoot(WorkflowPolicy::FinishAllAndError);
@@ -1069,13 +1069,13 @@ void tst_Tasking::testTree_data()
QTest::newRow("StopGroupAfterDoneWithContinueOnError")
<< TestData{storage, root2, errorLog, 3, OnDone::Failure};
const Group root3 = createRoot(WorkflowPolicy::StopOnDone);
QTest::newRow("StopGroupAfterDoneWithStopOnDone")
const Group root3 = createRoot(WorkflowPolicy::StopOnSuccess);
QTest::newRow("StopGroupAfterDoneWithStopOnSuccess")
<< TestData{storage, root3, doneLog, 3, OnDone::Failure};
// TODO: Behavioral change!
const Group root4 = createRoot(WorkflowPolicy::ContinueOnDone);
QTest::newRow("StopGroupAfterDoneWithContinueOnDone")
const Group root4 = createRoot(WorkflowPolicy::ContinueOnSuccess);
QTest::newRow("StopGroupAfterDoneWithContinueOnSuccess")
<< TestData{storage, root4, errorLog, 3, OnDone::Failure};
const Group root5 = createRoot(WorkflowPolicy::StopOnFinished);
@@ -1083,8 +1083,8 @@ void tst_Tasking::testTree_data()
<< TestData{storage, root5, doneLog, 3, OnDone::Failure};
// TODO: Behavioral change!
const Group root6 = createRoot(WorkflowPolicy::FinishAllAndDone);
QTest::newRow("StopGroupAfterDoneWithFinishAllAndDone")
const Group root6 = createRoot(WorkflowPolicy::FinishAllAndSuccess);
QTest::newRow("StopGroupAfterDoneWithFinishAllAndSuccess")
<< TestData{storage, root6, errorLog, 3, OnDone::Failure};
const Group root7 = createRoot(WorkflowPolicy::FinishAllAndError);
@@ -1140,12 +1140,12 @@ void tst_Tasking::testTree_data()
QTest::newRow("StopGroupAfterErrorWithContinueOnError")
<< TestData{storage, root2, longLog, 3, OnDone::Failure};
const Group root3 = createRoot(WorkflowPolicy::StopOnDone);
QTest::newRow("StopGroupAfterErrorWithStopOnDone")
const Group root3 = createRoot(WorkflowPolicy::StopOnSuccess);
QTest::newRow("StopGroupAfterErrorWithStopOnSuccess")
<< TestData{storage, root3, longLog, 3, OnDone::Failure};
const Group root4 = createRoot(WorkflowPolicy::ContinueOnDone);
QTest::newRow("StopGroupAfterErrorWithContinueOnDone")
const Group root4 = createRoot(WorkflowPolicy::ContinueOnSuccess);
QTest::newRow("StopGroupAfterErrorWithContinueOnSuccess")
<< TestData{storage, root4, longLog, 3, OnDone::Failure};
const Group root5 = createRoot(WorkflowPolicy::StopOnFinished);
@@ -1153,8 +1153,8 @@ void tst_Tasking::testTree_data()
<< TestData{storage, root5, shortLog, 3, OnDone::Failure};
// TODO: Behavioral change!
const Group root6 = createRoot(WorkflowPolicy::FinishAllAndDone);
QTest::newRow("StopGroupAfterErrorWithFinishAllAndDone")
const Group root6 = createRoot(WorkflowPolicy::FinishAllAndSuccess);
QTest::newRow("StopGroupAfterErrorWithFinishAllAndSuccess")
<< TestData{storage, root6, longLog, 3, OnDone::Failure};
const Group root7 = createRoot(WorkflowPolicy::FinishAllAndError);
@@ -1197,15 +1197,15 @@ void tst_Tasking::testTree_data()
};
QTest::newRow("ContinueOnError") << TestData{storage, root2, errorLog, 3, OnDone::Failure};
const Group root3 = createRoot(WorkflowPolicy::StopOnDone);
const Group root3 = createRoot(WorkflowPolicy::StopOnSuccess);
const Log log3 {
{1, Handler::Setup},
{1, Handler::Success},
{0, Handler::GroupSuccess}
};
QTest::newRow("StopOnDone") << TestData{storage, root3, log3, 3, OnDone::Success};
QTest::newRow("StopOnSuccess") << TestData{storage, root3, log3, 3, OnDone::Success};
const Group root4 = createRoot(WorkflowPolicy::ContinueOnDone);
const Group root4 = createRoot(WorkflowPolicy::ContinueOnSuccess);
const Log doneLog {
{1, Handler::Setup},
{1, Handler::Success},
@@ -1215,7 +1215,7 @@ void tst_Tasking::testTree_data()
{3, Handler::Success},
{0, Handler::GroupSuccess}
};
QTest::newRow("ContinueOnDone") << TestData{storage, root4, doneLog, 3, OnDone::Success};
QTest::newRow("ContinueOnSuccess") << TestData{storage, root4, doneLog, 3, OnDone::Success};
const Group root5 = createRoot(WorkflowPolicy::StopOnFinished);
const Log log5 {
@@ -1225,8 +1225,8 @@ void tst_Tasking::testTree_data()
};
QTest::newRow("StopOnFinished") << TestData{storage, root5, log5, 3, OnDone::Success};
const Group root6 = createRoot(WorkflowPolicy::FinishAllAndDone);
QTest::newRow("FinishAllAndDone") << TestData{storage, root6, doneLog, 3, OnDone::Success};
const Group root6 = createRoot(WorkflowPolicy::FinishAllAndSuccess);
QTest::newRow("FinishAllAndSuccess") << TestData{storage, root6, doneLog, 3, OnDone::Success};
const Group root7 = createRoot(WorkflowPolicy::FinishAllAndError);
QTest::newRow("FinishAllAndError") << TestData{storage, root7, errorLog, 3, OnDone::Failure};

View File

@@ -125,8 +125,8 @@ int main(int argc, char *argv[])
task_4_4->setBusyTime(6);
task_4_4->setBusyTime(3);
groupTask_1->setWorkflowPolicy(WorkflowPolicy::ContinueOnDone);
groupTask_4->setWorkflowPolicy(WorkflowPolicy::FinishAllAndDone);
groupTask_1->setWorkflowPolicy(WorkflowPolicy::ContinueOnSuccess);
groupTask_4->setWorkflowPolicy(WorkflowPolicy::FinishAllAndSuccess);
groupTask_4_3->setExecuteMode(ExecuteMode::Parallel);
groupTask_4_3->setWorkflowPolicy(WorkflowPolicy::StopOnError);

View File

@@ -65,7 +65,7 @@ void Images::process()
cancelButton->setEnabled(false);
};
QList<GroupItem> tasks {
finishAllAndDone,
finishAllAndSuccess,
parallel,
onGroupSetup(onRootSetup),
onGroupDone(onRootDone, CallDoneIf::Success)