Comments (9)
That is what I'm doing at the moment, but I thought this would a more appropriate approach and a nice addition to the library.
from lib-bpmn-engine.
@jinjaghost thanks for reminding me about #149 (and sorry for my late reply).
Since this issue and #149 do address the same need, of providing more freedom/flexibility in implementing handlers,
I do consider this one more simple. A generic handler function can implement anything.
Adding jsonlogic on top I don't have seen so often and don't consider that much of a benefit.
About the default handler ... I do consider this feature would already address this and helps us to get default handlers implemented. @jonathanbp would you add this logic as well, please (looks like a quick win to me)?
Happy to review any PR @jonathanbp and also adding "hacktoberfest-accepted" label with pleasure, in case you're participating.
Some implementation hints...
- add some example code in the documentation
- ensure documentation covers this new option
- unit tests are present
- for the default == CatchAll this could look like
engine.NewTaskHandler().CatchAll().Handler(myHandler);
internally, this function could simply use the newMatching()
function which always returns true == hence the quick win ;)
from lib-bpmn-engine.
What if no logic match a handler ? Do you imagine a default handler of last-resort ?
from lib-bpmn-engine.
@jonathanbp
thanks for proposing that feature ...
just another detail question, on that:
- would the current
BPMN20.Taskelement
have enough attributes, to fulfill your needs?
from lib-bpmn-engine.
@jinjaghost thanks for chiming in ... IMHO, the "default" handler is a concept, not present yet - and also would help for the other handlers as well.
I would suggest not to couple this issue with the general problem , but rather consider them separate feature.
What do you think?
from lib-bpmn-engine.
@jonathanbp May I ask, is this just a feature request, or do you consider participating the Hacktoberfest and prepare a PR as well?
from lib-bpmn-engine.
@jinjaghost thanks for chiming in ... IMHO, the "default" handler is a concept, not present yet - and also would help for the other handlers as well. I would suggest not to couple this issue with the general problem , but rather consider them separate feature. What do you think?
This issue is about adding some logic to task handler selection, i think that the "default" handler concept is part of it because in any case, it will be necessary to ultimately select a handler.
As in #149, jsonlogic would be a perfect fit to represent that logic.
from lib-bpmn-engine.
In my use-case the task element would probably have enough attributes to select the handler, but having a predicate would mean the decision as to which handler is selected can be controlled in the handler itself at runtime. I'd be happy to do a PR - I just wanted to check whether the idea meshed well with the other approaches or if there were other reasons not to do this or other and better approaches.
from lib-bpmn-engine.
If i am not missing something, why don't you run the decision logic from the main handler and call the right handler from there ?
from lib-bpmn-engine.
Related Issues (20)
- QUESTION: Process not in COMPLETED state? HOT 4
- Ensure that parallel flows are executed independently HOT 7
- QUESTION: How to execute a process in async way HOT 3
- Add support for link events HOT 3
- improve documentation: synchr. vs. asynch. jobs
- bpmn is driven through for temporal HOT 4
- Refactor using go-style Getters and Setters
- implement support for start timer event HOT 1
- evaluate expression using jsonlogic HOT 3
- Can lib-bpmn-engine specify participants via assignment handler? HOT 1
- replace `MessageSubscription.originaActivity` with some smarter solution
- add feature - Inclusive Gateway element HOT 1
- Inclusive gateway question. HOT 2
- IntermediateCatchEvent does not work with multiple running instances HOT 2
- How to implement user task? HOT 3
- improve error handling handleIntermediateTimerCatchEvent() HOT 1
- improve test coverage
- Rework engine-name to be optional HOT 5
- fix data house keeping / cleanup HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lib-bpmn-engine.