private BookmarkProviderContext GetBookmarkProviderContext(
            IActivityBlueprint activity,
            WorkflowExecutionContext workflowExecutionContext,
            CancellationToken cancellationToken,
            IDictionary <string, ActivityType> activityTypes)
        {
            var activityExecutionContext = _activityExecutionContextFactory.CreateActivityExecutionContext(
                activity,
                workflowExecutionContext,
                cancellationToken);

            var activityType = activityTypes[activity.Type];

            return(new BookmarkProviderContext(activityExecutionContext, activityType, BookmarkIndexingMode.WorkflowBlueprint));
        }
Ejemplo n.º 2
0
    private async Task <HttpEndpointDescriptor> GetHttpEndpointDescriptor(
        WorkflowExecutionContext workflowExecutionContext,
        WorkflowTrigger workflowTrigger,
        ICreatesActivityExecutionContextForActivityBlueprint activityExecutionContextFactory)
    {
        var activityId                   = workflowTrigger.ActivityId;
        var httpEndpointActivity         = workflowExecutionContext.WorkflowBlueprint.GetActivity(activityId) !;
        var httpEndpointBookmark         = (HttpEndpointBookmark)workflowTrigger.Bookmark;
        var activityExecutionContext     = activityExecutionContextFactory.CreateActivityExecutionContext(httpEndpointActivity, workflowExecutionContext, CancellationToken.None);
        var httpEndpointActivityAccessor = new ActivityBlueprintWrapper <HttpEndpoint>(activityExecutionContext);
        var displayName                  = httpEndpointActivity.DisplayName;
        var description                  = httpEndpointActivity.Description;
        var path       = httpEndpointBookmark.Path;
        var method     = httpEndpointBookmark.Method !;
        var targetType = await httpEndpointActivityAccessor.EvaluatePropertyValueAsync(x => x.TargetType);

        var schema = await httpEndpointActivityAccessor.EvaluatePropertyValueAsync(x => x.Schema);

        return(new HttpEndpointDescriptor(activityId, path, method, displayName, description, targetType, schema));
    }