private async Task <dynamic> BuildActivityDisplay(IActivity activity, int index, int workflowTypeId, string localId, string displayType)
        {
            dynamic activityShape = await _activityDisplayManager.BuildDisplayAsync(activity, this, displayType);

            activityShape.Metadata.Type  = $"Activity_{displayType}";
            activityShape.Activity       = activity;
            activityShape.WorkflowTypeId = workflowTypeId;
            activityShape.Index          = index;
            activityShape.ReturnUrl      = Url.Action(nameof(Edit), new { id = workflowTypeId, localId = localId });
            return(activityShape);
        }
        private async Task <dynamic> BuildActivityDisplay(IActivity activity, int index, string snippetName, string localId, string displayType)
        {
            dynamic activityShape = await _activityDisplayManager.BuildDisplayAsync(activity, _updateModelAccessor.ModelUpdater, displayType);

            activityShape.Metadata.Type = $"ActivityWorkflowSnippets_{displayType}";
            activityShape.Activity      = activity;
            //activityShape.WorkflowTypeId = workflowTypeId;
            activityShape.WorkflowSnippetId = snippetName;
            activityShape.Index             = index;
            activityShape.ReturnUrl         = Url.Action(nameof(Edit), new { sourcename = snippetName, localId = localId });
            return(activityShape);
        }
Example #3
0
        public async Task <IShape> BuildDesignShapeAsync(IActivity activity, CancellationToken cancellationToken)
        {
            var     descriptor = activity.Descriptor;
            dynamic shape      = await displayManager.BuildDisplayAsync(activity, null, "Design");

            var customFields     = activity.Metadata.CustomFields;
            var designerMetadata = customFields.GetValue("Designer", StringComparison.OrdinalIgnoreCase)?.ToObject <ActivityDesignerMetadata>() ?? new ActivityDesignerMetadata();

            shape.Metadata.Type      = $"Activity_Design";
            shape.Endpoints          = descriptor.GetEndpoints(activity).ToList();
            shape.ActivityDescriptor = descriptor;
            shape.Activity           = activity;
            shape.Designer           = designerMetadata;

            return(shape);
        }
Example #4
0
        private async Task <dynamic> BuildActivityDisplayAsync(ActivityContext activityContext, int workflowTypeId, bool isBlocking, string displayType)
        {
            dynamic activityShape = await _activityDisplayManager.BuildDisplayAsync(activityContext.Activity, this, displayType);

            activityShape.Metadata.Type  = $"Activity_{displayType}ReadOnly";
            activityShape.Activity       = activityContext.Activity;
            activityShape.ActivityRecord = activityContext.ActivityRecord;
            activityShape.WorkflowTypeId = workflowTypeId;
            activityShape.IsBlocking     = isBlocking;
            return(activityShape);
        }