specification icon indicating copy to clipboard operation
specification copied to clipboard

workflow.id and workflow.key is duplicate

Open lsytj0413 opened this issue 3 years ago • 9 comments

What would you like to be added:

Only keep one of id or key property in workflow.

Why is this needed:

As the description:

The id property defines the unique, domain-specific workflow identifier, for example "orders", "payment", etc.

The key property defines the unique, domain-specific workflow identifier. It can be used when the id property is auto-generated by a content-management system for example. In these cases, you can specify the key property to be the domain-specific identifier of the workflow definition. The id and key properties are mutually exclusive, meaning you cannot define both.

The id & key property is exclusive,we can only have one of them, but when id is auto-generated (which means it have an value), we cannot define the key property, so the use case is wrong.

lsytj0413 avatar Jan 28 '23 08:01 lsytj0413

hi, i think the community member use case for this was that id is generated by some third party tool like a cms system so it would not be in the workflow definition (thus exclusive). can you describe your use case is the generated id in the json/yaml definition?

tsurdilo avatar Jan 29 '23 03:01 tsurdilo

hi, i think the community member use case for this was that id is generated by some third party tool like a cms system so it would not be in the workflow definition (thus exclusive). can you describe your use case is the generated id in the json/yaml definition?

If id is generated by a cms system and not in workflow definition, why we must use another property named key to define the identifier?

As we keep both id and key property, there is some problem:

  1. it's will be confused to the user, they don't know the difference between these two and which property is used in which scenario
  2. if the user have a workflow definition with id=1, and after a period of time change to key=1, Is they are the same identified workflow definition?

lsytj0413 avatar Jan 29 '23 06:01 lsytj0413

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Mar 16 '23 00:03 github-actions[bot]

The way I see and use it, key is used at instantiation time to provide a unique identifier to instances of a workflow based on runtime expressions. The real issues, imho, are:

  • the uselessness of id when name/version pair are used to identify a definition
  • the mutual exclusiveness of id and key

On a side note, there are many problems with naming conventions, as discussed in related issue #671 , which breaks expression functions, for example

cdavernas avatar May 12 '23 08:05 cdavernas

The way I see and use it, key is used at instantiation time to provide a unique identifier to instances of a workflow based on runtime expressions.

If this is the use case,so user cannot provide it (because runtime will always rewrite it).

lsytj0413 avatar May 18 '23 01:05 lsytj0413

did we come to some consensus if we wanna remove this or not?

tsurdilo avatar May 18 '23 04:05 tsurdilo

I'm not sure! Let's wait next community meeting if that's ok

cdavernas avatar May 18 '23 09:05 cdavernas

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Jul 10 '23 00:07 github-actions[bot]

See https://github.com/serverlessworkflow/specification/discussions/817#discussioncomment-8408714

ricardozanini avatar Feb 08 '24 15:02 ricardozanini

@ricardozanini Working on this one, can you update the status label?

fjtirado avatar Feb 19 '24 12:02 fjtirado