Esempio n. 1
0
        public async Task <IActionResult> Create(string activityName, [FromBody] JToken json, CancellationToken cancellationToken)
        {
            var activityDescriptor = await activityLibrary.GetByNameAsync(activityName, cancellationToken);

            var activity = activityDescriptor.InstantiateActivity(json);

            activity.Id = Guid.NewGuid().ToString().Replace("-", "");

            var editorShape = await displayManager.BuildEditorAsync(activity, this, false);

            var activityToken = await workflowTokenizer.TokenizeActivityAsync(activity, cancellationToken);

            var model = new ActivityEditorEditViewModel
            {
                ActivityJson        = activityToken.ToString(),
                ActivityEditorShape = editorShape,
            };

            return(View("Edit", model));
        }
Esempio n. 2
0
 private Task <ActivityDescriptor> GetActivityDescriptorAsync(string activityName, CancellationToken cancellationToken)
 {
     return(activityLibrary.GetByNameAsync(activityName, cancellationToken));
 }