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

#254 Create schedule is adding it disabled and they are ran #255

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

florentinvintila
Copy link

Closes #254

When scheduler is active create schedule is adding it disabled and they are ran.

Comment on lines 208 to 210
if (WorkflowScheduleType.runOnce.equals(scheduleEntity.getType()){
scheduleEntity.setStatus(WorkflowScheduleStatus.active);
}
Copy link
Member

Choose a reason for hiding this comment

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

Hey @florentinvintila can you clarify, do we want all schedules to be created active or just runonce schedules?

On line 207 we set the status to trigger_disabled... but the wrapping condition on 206 is that the trigger is enabled. Should we be removing line 207 and just set to active for all types?

Copy link
Author

Choose a reason for hiding this comment

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

@tlawrie for this case setting all to enabled seems to be the solution. But I would like to understand what each status represents and for what they were intended to be used.

AndreiOla and others added 7 commits January 20, 2023 17:01
* fix properties

* remove CE labels

* fix workflow password parameters

* fix conversion

* fix conversion

* fix conversion

* refactor

* fix conversion

* fix npe

* update property processing

* upgrade jacoco version
* set default appName for external Nav API

* refine UI Header for external navigation URL

* default appName to Settings
* This is split from Eventing Branch, with general fixes, not directly related to Eventing

* Undo changes for one file

* Put back description

* Revert some shanges
@tlawrie
Copy link
Member

tlawrie commented Jan 27, 2023

Hi @florentinvintila @AndreiOla this PR seems to have a whole number of commits pulled in which make it quite hard to review. Do you want to cherry pick the change over to a different branch? or undo some of the commits that have been pulled in that don't relate to the PR?

In terms of what is the check meant to be doing, I think it's actually the check that needs to be fixed...

Boolean enableJob = false;
          if (WorkflowScheduleStatus.active.equals(schedule.getStatus()) && wfEntity.getTriggers().getScheduler().getEnable()) {
            scheduleEntity.setStatus(WorkflowScheduleStatus.trigger_disabled);
            enableJob = true;
          }

In the above, I think the check for wfEntity.getTriggers().getScheduler().getEnable() should actually be not !wfEntity.getTriggers().getScheduler().getEnable() and therefore set to disabled status.

The reason I say that is

  1. The ScheduleEntity is created with status to active. So setting it to active (as is the update in PR) doesn't really do anything.
  2. The execution code is then meant to check on that status and not execute the schedule.

An alternate fix might be needed.

@tlawrie
Copy link
Member

tlawrie commented Jan 27, 2023

The solution may be

          Boolean enableJob = false;
          if (WorkflowScheduleStatus.active.equals(scheduleEntity.getStatus()) && wfEntity.getTriggers().getScheduler().getEnable()) {
            enableJob = true;
          } else if (WorkflowScheduleStatus.active.equals(scheduleEntity.getStatus()) && !wfEntity.getTriggers().getScheduler().getEnable()) {
            scheduleEntity.setStatus(WorkflowScheduleStatus.trigger_disabled);
          }

I can't test it as I am in the middle of v4 of Workflow

@tlawrie
Copy link
Member

tlawrie commented Jan 27, 2023

I added the code to this branch. Let me know if it works or not #261

@tlawrie
Copy link
Member

tlawrie commented Feb 12, 2023

hey @florentinvintila checking in on the above... if the solution on the proposed branch is good, we can open a second PR for the v4 branch as well.

@tlawrie
Copy link
Member

tlawrie commented Mar 30, 2023

Hi @florentinvintila @amhudson @gchickma checking in if the proposed fix #261 was a fix for this?

@amhudson
Copy link
Member

Hi @florentinvintila @amhudson @gchickma checking in if the proposed fix #261 was a fix for this?

Looks to be

@tlawrie
Copy link
Member

tlawrie commented Apr 3, 2023

Hi @florentinvintila @amhudson @gchickma checking in if the proposed fix #261 was a fix for this?

Looks to be

Hi @amhudson so am I good to close this PR and merge in #261 ?

@amhudson
Copy link
Member

amhudson commented Apr 4, 2023

@tlawrie I think so

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.

Create schedule is adding it disabled and they are ran.
5 participants