Skip to content

workflow overhaul - #16682

Merged
rullzer merged 69 commits into
masterfrom
enh/12790/workflow-backend
Sep 11, 2019
Merged

workflow overhaul#16682
rullzer merged 69 commits into
masterfrom
enh/12790/workflow-backend

Conversation

@blizzz

@blizzzblizzz commented Aug 7, 2019

Copy link
Copy Markdown
Member

for #12790

What I have discussed today with @juliushaertl to support the frontend/design concept.

Basics

  • WfE Manager must be able to deal not only with files
  • convert controller to OCS Apis for
    • Admins
    • users
  • Provide the list of operators with the initState mechanism to the rendering frontend
    • also means: Settings for Admins (PHP part)
    • Settings for Users (PHP part)
  • WorkflowEngine (WfE) will take care about event listening itself. Currently Operators do it themselves. This aims for simplification and standardization. Will only utilize the EventDispatcher and only post_$ events).
  • Interface definitions for operators.
    • IGenericOperator – an Entity agnostic operator (e.g. "Post to conversation" is a valid action on any Event
    • ISpecificOperator – bound to a specific Entity like "Block access" or "Tag with" to files, which is due to limitations of one sort or another and cannot quickly be resolved, too.
    • IFixedEventListener – better name needed. A specialization where the operator does take care about event listening itself. For intance needed for "Block access", because it works with storage wrappers. Or when an event is thrown with a different mechanism than the EventDispatcher.
  • Provide a list of Entities/Events
    • a curated list of supported Events, shipped by the WfE. We would favor discoverability via EventDispatcher but we are afraid that not all events are there at runtime, and also it does not provide user facing names. Might be something for the future.
    • a mechanism to register more Event types. Necessary for the pdf converter, since it has an external dependency on a local LibreOffic, and potential apps.
    • an Entity prrovides name, id and list of events (which itself go with an id, name)
  • Convert DB schema to migration
  • extend Database to contain
    • scope (Admins, Users, Groups?)
    • configured events to listen to
  • Whitelisted for users
    • Checkers
    • Operators

Good to have

  • OCC command for admins to manipulate the workflow, at least to disable user workflows that might be stressful for the instance
  • CompoundEntity – predefined for end users: an entity with one or more checkres, e.g. "Picture" (File + mimetype) or "One on one" (direct chat).

(internal) Vocabulary

  • Operator – an action to achieve, like "Block access" (files_accesscontrol), "Convert to PDF", etc. with its business logic
  • Entity – a thing that emits events (File, Talk conversation, Calendar…)
  • Event – the combination of an Entity with one or more specific events (File modified, Conversation message posted, …)
  • Checker – at least the old name. A constraint like "File type", "Request time", etc.

App modifications

The list does not claim to be complete. The more we dig, the more comes to our mind…

@blizzzblizzz added this to the Nextcloud 18 milestone Aug 7, 2019
@blizzz
blizzz requested a review from juliusknorrAugust 7, 2019 15:22
@juliusknorrjuliusknorr mentioned this pull request Aug 9, 2019
35 tasks
@Spartachetto

Copy link
Copy Markdown

Could this be used to implement #1291?

@blizzz

Copy link
Copy Markdown
MemberAuthor

@Spartachetto Yes, totally!

@SpartachettoSpartachetto mentioned this pull request Aug 12, 2019
@blizzz
blizzzforce-pushed the enh/12790/workflow-backend branch from 5f95c33 to 62ab277CompareAugust 12, 2019 14:38
new GenericEntityEmitterEvent($emitterClass, $slot, 'postWrite', $this->l10n->t('File updated')),
new GenericEntityEmitterEvent($emitterClass, $slot, 'postRename', $this->l10n->t('File renamed')),
new GenericEntityEmitterEvent($emitterClass, $slot, 'postDelete', $this->l10n->t('File deleted')),
new GenericEntityEmitterEvent($emitterClass, $slot, 'postTouch', $this->l10n->t('File accessed')),

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be preRead or is the touch happening before the file is actually read?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah no this will be using an IFixedEventListener, but we should make sure we still have an event definition exposed for those cases to the frontend.

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The original idea was that for special edge cases, the operators take care of listening to the right hooks and doing the right things (wrapper). But you're right, we need to present it somehow.

@blizzz
blizzzforce-pushed the enh/12790/workflow-backend branch 2 times, most recently from cb4bd79 to 9d9a333CompareAugust 27, 2019 16:01
Comment threadapps/workflowengine/lib/Settings/ASettings.php
Comment threadapps/workflowengine/appinfo/info.xml Outdated
@blizzz
blizzzforce-pushed the enh/12790/workflow-backend branch from 700c038 to ae2bf15CompareAugust 28, 2019 21:56
@juliusknorr

This comment has been minimized.

Comment threadapps/workflowengine/lib/Manager.php Outdated
Comment threadapps/workflowengine/lib/Controller/AWorkflowController.php Outdated
Comment threadapps/workflowengine/lib/Controller/AWorkflowController.php Outdated
Comment threadapps/workflowengine/lib/Controller/AWorkflowController.php Outdated
@blizzz

This comment has been minimized.

@blizzz
blizzzforce-pushed the enh/12790/workflow-backend branch from c1b5bbd to 6c75aa4CompareAugust 29, 2019 13:27
@juliusknorr

This comment has been minimized.

@blizzz
blizzzforce-pushed the enh/12790/workflow-backend branch 3 times, most recently from ce12c14 to 3714965CompareSeptember 5, 2019 11:46
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
juliusknorrand others added 10 commits September 10, 2019 09:01
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
@blizzzblizzz added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Sep 10, 2019
@blizzzblizzz changed the title workflow backend overhaulworkflow overhaulSep 10, 2019
Comment threadapps/workflowengine/appinfo/info.xml Outdated
<name>Nextcloud workflow engine</name>
<summary>Nextcloud workflow engine</summary>
<description>Nextcloud workflow engine</description>
<version>1.8.0</version>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please bump this a bit.

@rullzerrullzer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some quick smoke testing tells me lets do this.

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
@blizzzblizzz added 4. to release Ready to be released and/or waiting for tests to finish and removed 3. to review Waiting for reviews labels Sep 11, 2019
Signed-off-by: Julius Härtl <jus@bitgrid.net>
@rullzer
rullzer merged commit 2187f85 into masterSep 11, 2019
@rullzer
rullzer deleted the enh/12790/workflow-backend branch September 11, 2019 11:14
@blizzzblizzz mentioned this pull request Sep 11, 2019
16 tasks
skjnldsv added a commit that referenced this pull request Oct 4, 2019
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

4. to releaseReady to be released and/or waiting for tests to finishenhancementfeature: workflows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@blizzz@Spartachetto@juliusknorr@rullzer