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

Workflow engine foundations #1172

Merged
merged 5 commits into from
Jul 11, 2019
Merged

Workflow engine foundations #1172

merged 5 commits into from
Jul 11, 2019

Conversation

antho1404
Copy link
Member

@antho1404 antho1404 commented Jul 7, 2019

Basic implementation of workflow.
For now, workflows are limited to only event and a single task (final implementation will be event or result and multiple tasks)

Testing:

service.json

{"sid":"test-workflow","name":"Test workflow","tasks":[{"key":"taskX","inputs":[{"key":"foo","type":"String","object":[]},{"key":"bar","type":"String","object":[]}],"outputs":[{"key":"res","type":"Any","object":[]}]}],"events":[{"key":"eventX","data":[{"key":"foo","type":"String","object":[]},{"key":"bar","type":"String","object":[]}]}],"dependencies":[],"source":"QmQvRzJPFDhyBGK2rQP5mAeMrgp1XsTB8WYK2c7FHvyAB8"}
grpcurl -plaintext -d "$(cat service.json)" localhost:50052 api.Service/Create
grpcurl -plaintext -d "{\"serviceHash\":\"C8Go4Dmuc6hJaxQZzii6Jcp8ym2fhynULabKf4VowpCx\"}" localhost:50052 api.Instance/Create
grpcurl -plaintext -d "{\"filter\": {\"statuses\": [\"Completed\"]}}" localhost:50052 api.
Execution/Stream

🎉 you have new executions created because of the event from the service that is triggered by this workflow

@antho1404 antho1404 marked this pull request as ready for review July 8, 2019 16:51
@antho1404 antho1404 self-assigned this Jul 9, 2019
@antho1404 antho1404 added the enhancement New feature or request label Jul 9, 2019
@antho1404 antho1404 requested review from NicolasMahe and krhubert and removed request for NicolasMahe July 9, 2019 15:37
// Workflow exposes functions of the workflow
type Workflow struct {
event *eventsdk.Event
eventStream *eventsdk.Listener
Copy link
Contributor

Choose a reason for hiding this comment

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

eventStream is used only in start method so it can be removed here

Copy link
Member Author

Choose a reason for hiding this comment

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

This is used to check that the workflow engine is not started already and we should keep it in order to close the listener when we stop the workflow engine (not yet implemented)

workflow/workflow.go Outdated Show resolved Hide resolved
@antho1404 antho1404 added this to the next milestone Jul 10, 2019
@antho1404 antho1404 merged commit 44a1e9b into dev Jul 11, 2019
@antho1404 antho1404 deleted the feature/workflow-engine branch July 11, 2019 10:45
@antho1404 antho1404 mentioned this pull request Jul 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants