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

Domain Process Coordinator - Execute Action Asynchronously when true #95

Merged
merged 2 commits into from
Feb 4, 2024

Conversation

rygramer
Copy link
Contributor

@rygramer rygramer commented Jan 15, 2024

Hi @ImJohnMDaniel,

Hope you're well! Might I propose this change? I recently ran into a use case when the DomainProcessAbstractAction that ships with the framework did not meet my requirements. The scope of my use case, however, was limited to the methods provided by IDomainProcessAction (I did not need to implement IDomainProcessQueueableAction).

So, in my action class, instead of extending DomainProcessAbstractAction, I just implemented IDomainProcessAction. When I did this, I ran into this issue with the DomainProcessCoordinator. Because the coordinator is checking whether currentDomainProcess.ExecuteAsynchronous__c != null (it will never be null since it is a boolean field), by proxy we must always implement IDomainProcessQueueableAction. If we switch the if to just check for if ExecuteAsynchronous__c = true, then we do not have to implement IDomainProcessQueueableAction.

Curious to know your thoughts on this,
Ryan


This change is Reviewable

@ImJohnMDaniel
Copy link
Collaborator

G'day @rygramer. Thanks for reaching out. This is an interesting catch. I will need to think about the implications of fixing this line of code. Let me consult with @stohn777 and think about it for a bit and get back to you by next week.

@rygramer
Copy link
Contributor Author

Copy, thanks @ImJohnMDaniel!

@ImJohnMDaniel
Copy link
Collaborator

G'day @rygramer. After consulting with @stohn777 a bit on this, I made a slight adjustment to the solution that you are proposing. Basically, it is going to perform a type check as well before setting the action to run in queue. If this works with your use case, then we will approve and merge the changes. Just let me know when you can. Cheers!

@rygramer
Copy link
Contributor Author

rygramer commented Feb 3, 2024

Sounds great! Thanks @ImJohnMDaniel @stohn777

@ImJohnMDaniel ImJohnMDaniel added bug Something isn't working and removed investigating labels Feb 4, 2024
@ImJohnMDaniel ImJohnMDaniel merged commit fbbd471 into apex-enterprise-patterns:master Feb 4, 2024
1 check passed
@ImJohnMDaniel
Copy link
Collaborator

Thanks @rygramer for the help!!! Very much appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants