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

Auto name activity #3035

Merged
merged 2 commits into from
May 17, 2022
Merged

Auto name activity #3035

merged 2 commits into from
May 17, 2022

Conversation

sfmskywalker
Copy link
Member

@sfmskywalker sfmskywalker commented May 17, 2022

This PR adds a designer feature that will autogenerate activity names. Example:

auto-name-activities-demo

The default naming strategy is camel case*, but there are other ones available. This is the list out of the box:

  • PascalCaseStrategy
  • CamelCaseStrategy
  • SnakeCaseStrategy
  • KebabCaseStrategy

Additionally, custom strategies can be configured.

Here's an example demonstrating how to configure a strategy from the HTML page hosting the designer:

<script type="module">
  // Import publicly exposed plugins, services and models to use in vanilla JavaScript.
  import {Container, ActivityNameFormatter} from "/build/index.esm.js"; // Use NPM package once released.

  // Get a reference to the ActivityNameFormatter.
  const activityNameFormatter = Container.get(ActivityNameFormatter); // Using service locator to get a reference to a service.

  // Install your preferred naming strategy:
  activityNameFormatter.strategy = ActivityNameFormatter.CamelCaseStrategy;

  // Or install a custom name formatter strategy (which is a simple function that receives a context and should return the resulting activity name as a string).
  //activityNameFormatter.strategy = context => `${context.activityDescriptor.activityType}_${context.count}`;

</script>

Closes #2874

@sfmskywalker sfmskywalker merged commit 2881e87 into v3 May 17, 2022
@sfmskywalker sfmskywalker deleted the v3-auto-name-activity branch May 17, 2022 18:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

1 participant