Conversation
When a flow reacts to a tag assignment of the approval app, the actor placeholder %a resolves to the approver on approval and rejection, while scripts typically need to act for the user who requested the approval (e.g. move the file into their space). The approval app emits an ApprovalStateChangedEvent carrying the requester right before changing its tags. The new listener stores it in the request-scoped RequesterContext, so it is substituted when the workflow engine reacts to the tag change within the same request. When no requester is known, the command is not executed and a warning is logged, consistent with the %n placeholder. Requires the approval app to emit the event, see nextcloud#363 Signed-off-by: eli <shark_xc@hotmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #363 — requires the approval app counterpart: nextcloud/approval#449
What this does
Adds a
%rplaceholder that is substituted with the user id of the approval requester.When a flow rule reacts to the approval app's tag assignments, the existing placeholders cannot provide the requester:
%aresolves to the approver on approve/reject and%oto the file owner. The approval app emits anApprovalStateChangedEventcarrying the requester right before it (un)assigns its tags (see the linked approval PR).Since the workflow engine reacts to the tag change synchronously within the same request, the new
ApprovalStateChangedListenerstores the requester in the request-scopedRequesterContext, andbuildCommand()substitutes%rfrom there.Behavior notes
PlaceholderNotSubstituted: the command is not executed and a warning is logged, consistent with%n.%ris also substituted on approval requests (pending tag), where it usually matches%a, but also covers (auto-)tagging scenarios without a session user.The README placeholder table is updated accordingly.