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

Warn if there is more than one primary process association #15

Open
stephanpelikan opened this issue Dec 31, 2023 · 0 comments
Open

Warn if there is more than one primary process association #15

stephanpelikan opened this issue Dec 31, 2023 · 0 comments

Comments

@stephanpelikan
Copy link
Contributor

This causes an unpredictable process to start:

@WorkflowService(workflowAggregateClass.class = MyAggregate.class)
public class FirstWorkflow {
    @Autowired
    private ProcessService<MyAggregate> processService;

    public void start() {
         processService.startWorkflow(new MyAggregate()); // <-- this might start process "SecondWorkflow"
    }
}

@WorkflowService(workflowAggregateClass.class = MyAggregate.class)
public class SecondWorkflow { ... }

This behavior is because there are two primary workflows associated with the aggregate class. The correct annotations are

@WorkflowService(workflowAggregateClass.class = MyAggregate.class)
public class FirstWorkflow { ... }

@WorkflowService(
        workflowAggregateClass.class = MyAggregate.class,
        bpmnProcess = @BpmnProcess(bpmnProcessId = "FirstWorkflow"),
        secondaryBpmnProcesses = { @BpmnProcess(bpmnProcessId = "SecondWorkflow") })
public class SecondWorkflow { ... }

On wiring VanillaBP should detect thus wrong annotations and hint the developer to fix this.

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

No branches or pull requests

1 participant