Skip to content
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

Enable first step as automatic task #4853

Closed

Conversation

BartChris
Copy link
Collaborator

@BartChris BartChris commented Nov 30, 2021

Hello,
Right now it is not possible to define the first task in the workflow as an automatic task since the necessary checks seem only to be performed after another task is closed.

for (Task automaticTask : automaticTasks) {
automaticTask.setProcessingBegin(new Date());
TaskScriptThread thread = new TaskScriptThread(automaticTask);
TaskManager.addTask(thread);
}

In order to enable an automatic first task i added a check after the process is created and defined the necessary logic to start the automatic task. The solution works in my environment but please check if i am missing something.

Fixes #4276 and #3672

@markusweigelt
Copy link
Collaborator

@BartChris Please fix checkstyle problems. Thx.

Copy link
Collaborator

@markusweigelt markusweigelt left a comment

Choose a reason for hiding this comment

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

  • Combine nested if to one
  • Rename function with more suitable name

@BartChris BartChris marked this pull request as draft December 1, 2021 07:16
@BartChris
Copy link
Collaborator Author

BartChris commented Dec 1, 2021

This requires more, open questions:

  • what about other scenarios of creating processes?
  • should the same behavior be implemented everywhere a new process with attached workflow and open tasks is created?
  • what about automatic imports of child processes?

Marking this as a draft, see #3672 (comment)

@BartChris
Copy link
Collaborator Author

Closed, needs more thoughts on side effects- See related issue.

@BartChris BartChris closed this May 30, 2022
@BartChris BartChris deleted the first_step_as_automatic_step branch August 17, 2022 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Script of automatic task is not called if task is first workflow step
2 participants