Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
moodle-tool_lifecycle
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
elc
moodle-tool_lifecycle
Commits
6fef929a
Commit
6fef929a
authored
6 years ago
by
Justus Dieckmann
Browse files
Options
Downloads
Patches
Plain Diff
Rollback implementation
parent
1cf86f06
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
classes/manager/process_manager.php
+11
-1
11 additions, 1 deletion
classes/manager/process_manager.php
step/lib.php
+11
-0
11 additions, 0 deletions
step/lib.php
with
22 additions
and
1 deletion
classes/manager/process_manager.php
+
11
−
1
View file @
6fef929a
...
...
@@ -159,7 +159,17 @@ class process_manager {
* @param process $process process the rollback should be triggered for.
*/
public
static
function
rollback_process
(
$process
)
{
// TODO: Add logic to revert changes made by steps.
for
(
$i
=
$process
->
stepindex
-
1
;
$i
>=
1
;
$i
++
)
{
$step
=
step_manager
::
get_step_instance_by_workflow_index
(
$process
->
workflowid
,
$i
);
$lib
=
lib_manager
::
get_step_lib
(
$step
->
subpluginname
);
try
{
$course
=
get_course
(
$process
->
courseid
);
}
catch
(
\dml_missing_record_exception
$e
)
{
// Course no longer exists!
break
;
}
$lib
->
rollback_course
(
$process
->
id
,
$step
->
id
,
$course
);
}
self
::
remove_process
(
$process
);
}
...
...
This diff is collapsed.
Click to expand it.
step/lib.php
+
11
−
0
View file @
6fef929a
...
...
@@ -75,6 +75,17 @@ abstract class libbase {
public
function
post_processing_bulk_operation
()
{
}
/**
* Rolls back all changes made to the course
*
* @param int $processid of the respective process.
* @param int $instanceid of the step instance.
* @param mixed $course to be rolled back.
*/
public
function
rollback_course
(
$processid
,
$instanceid
,
$course
)
{
}
/**
* The return value should be equivalent with the name of the subplugin folder.
* @return string technical name of the subplugin
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment