-
-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Task assignee issue #19
Comments
Hi @jordotech, Thanks for reaching out. You make an excellent point. I honestly just added the field for future usage, but haven't come around to actually implement user assignment and something resembling a task inbox. Let's talk possible solutions before I go ahead an implement something. I'd really like to get your input on the ideas I have for this. So, each task creates the next tasks after executing itself successfully. How that is done depends on whether the next task implements a Essentially, you could provide create a class MyCustomUpdateView(tasks.UpdateView):
def create_task(self, workflow):
return workflow.task_set.create(
name=self.name,
type=self.type,
completed=None,
asignees=[], # add your user here
) However, there are a couple of problems, that need to be address for this to be viable solution:
Regarding 1Let's say you have a scenario, where you want to assign the next task the same user that currently completes the task at hand. You could get the last task owner form the previous task, but that is not given to the However, not all tasks are created from a human task. They could be created by a machine tasks. Not having a request would be more consistent. I'd opt for now having a request here. Regarding 2Event thought in my example the I hope my answer wasn't too long. I just wanted to give you all the info you need. BTW, thanks for becoming a sponsor <3 It really makes a difference, if only emotionally. Best, |
I agree with you on point 1, I would opt to not using the request object there. For what it's worth, the following is working quite nicely for me and does not introduce breaking changes. ModelI made a new model where you configure users to task names:
The problem with the above is that I'm manually entering the task method name into the admin form which is not very elegant. Maybe the field could be a choices field that pulls options from a new setting
SignalThen a
Now I have proper "My Tasks" dashboards with pending/complete tasks. The main problem I have faced with joeflow is referencing the For example, I have not been able to implement the following (simplified) workflow. The idea is to email someone that they've been assigned and provide a link to the next
|
Hi @jordotech, Thanks for your patience. I needed a little to find time for a thorough response. No request. Great, then that's how we will build it. Tasks assignment is a tricky thing, I agree. Especially if you have want to assign a task that does not exist yet. I would probably separate the two scenarios. One where tasks get auto-assigned and one where tasks get assigned by humans. For the latter a simple task create method should be sufficient. For the further we will need two views. One that resembles a tasks inbox and one that handles reassignments and notifications. If a user can reassign a tasks or not could be restricted by permissions. However, those should probably be per process not per task. A task could have a If that worked for you, I would go ahead and try to implement a solution over the weekend and add documentation on how to extend the default behavior. Best, |
@jordotech I worked on a draft this weekend on how to do task assignment. I'd really like your feedback. I will try to find time soon to also develop a proper task inbox. |
Thanks for that! I just reviewed the additions, looking good. Regarding the UpdateWithPrevUserView: For reference, this is a flowchart of the real workflow I've developed with joeflow: In this scenario there are 2 Django users who are always auto-assigned as "preliminary approver" and "final approver". |
Yes, I too thought of a select input, similar to how issues and pull-requests are assigned here on GitHub. I am finishing up the |
I am currently adding assignees to a Task object via a
post_save
signal by matching thetask.name
against a string. Is it possible to add an assignee from within a workflow method?The text was updated successfully, but these errors were encountered: