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

Add constant to process map #1316

Merged
merged 4 commits into from
Sep 12, 2019
Merged

Add constant to process map #1316

merged 4 commits into from
Sep 12, 2019

Conversation

antho1404
Copy link
Member

@antho1404 antho1404 commented Sep 9, 2019

Add support of constants for mapping.

Constants are helpful to get the user inputs, specific value, specific function for conversion using service-js, add value that is not part of any result...

It is only possible to set either a ref or a constant for a mapping.

To test:

Services

# serviceA
{"name":"serviceA","tasks":[{"inputs":[{"type":"String","key":"message"}],"outputs":[{"type":"String","key":"value"}],"key":"taskX"},{"key":"emits"}],"events":[{"data":[{"type":"String","key":"message"}],"key":"eventX"}],"configuration":{},"hash":"6QkdJaTHbx3qYT4H169twd7A2pzxDJt8MTy882h9nevn","sid":"serviceA","source":"QmTQW4Dnq44oU2DLq5dxXCHRNEQWaDaGc9ZKDmG1ocJGuv"}

# serviceB
{"name":"serviceB","tasks":[{"inputs":[{"type":"String","key":"inputA"}],"outputs":[{"type":"String","key":"res"}],"key":"taskY"}],"configuration":{},"hash":"j64r3wPevCd8f1vcZVNePBvnwRw6kZKdunAtRtd9hCY","sid":"serviceB","source":"QmQu8kCwPJ1Qydrawmz4STkY4FAwxrZHgkui83umkp94iq"}

Process

key: Event
steps:
  - type: trigger
    instanceHash: H74Qqq8nT5JZ9GSJmuSWLN5benWZPkUb5pYcvQLsoZX 
    eventKey: eventX
  - type: task
    instanceHash: DTjy36ApV5YVbyXm67iWeAsD9uCbZETcPL1TbUPwHeYJ
    taskKey: taskY
    inputs:
      inputA: hello world

You can use the CLI from this Pull Request mesg-foundation/cli#153 in order to test with the API updated

@antho1404 antho1404 self-assigned this Sep 11, 2019
@antho1404 antho1404 added the enhancement New feature or request label Sep 11, 2019
@antho1404 antho1404 added this to the next milestone Sep 11, 2019
@antho1404 antho1404 requested review from krhubert and NicolasMahe and removed request for krhubert September 11, 2019 10:38
@antho1404 antho1404 marked this pull request as ready for review September 11, 2019 10:39
protobuf/types/process.proto Show resolved Hide resolved
return nil, err
}
if ref := output.GetRef(); ref != nil {
if ref == nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

ref will never be nil here (look above if check)

Copy link
Member Author

@antho1404 antho1404 Sep 12, 2019

Choose a reason for hiding this comment

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

good catch, got some issue with a conflict while rebasing may be coming from that.

@antho1404 antho1404 merged commit 5efe30e into dev Sep 12, 2019
@antho1404 antho1404 deleted the feature/process-map-constants branch September 12, 2019 05:09
@NicolasMahe NicolasMahe added the release:add Pull requests that add something label Sep 12, 2019
@NicolasMahe NicolasMahe mentioned this pull request Sep 23, 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 release:add Pull requests that add something
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants