public ActorRequestContext(string managerId, string actionName, string requestId = null, FlowInstanceId flowInstanceId = null) : this()
 {
     ManagerId      = managerId;
     ActionName     = actionName;
     RequestId      = requestId;
     FlowInstanceId = flowInstanceId;
 }
 protected async Task TryCreateFlow(string applicationName, FlowInstanceId flowInstanceId, string startedPayload)
 {
     try
     {
         var startRequest = new StartFlowRequest()
         {
             FlowInstanceId = flowInstanceId,
             StartDate      = DateTime.UtcNow,
             UserStarted    = $"{this.GetType().Name} - {flowInstanceId.Id}",
             StartedPayload = startedPayload
         };
         await AsyncActorFlow.CreateFlowAsync(new ActorIdentity(Guid.NewGuid().ToString(), applicationName), flowInstanceId, startRequest, CancellationToken.None);
     }
     catch (Exception ex)
     {
         Logger.LogInformation(ex, $"Failed to create flow to flow service");
     }
 }
示例#3
0
 protected abstract Task <bool> FlowInitialize(ActorRequestContext actorRequestContext, FlowInstanceId flowInstanceId, CancellationToken cancellationToken);
示例#4
0
 public virtual Task <bool> InitFlowAsync(ActorRequestContext actorRequestContext, FlowInstanceId flowInstanceId, CancellationToken cancellationToken)
 {
     FlowInstanceId = flowInstanceId;
     FlowServiceUri = actorRequestContext.ManagerService;
     return(FlowInitialize(actorRequestContext, flowInstanceId, cancellationToken));
 }
 public ActorRequestContext(string managerId, string actionName, string requestId = null, ActorIdentity targetActor = null, FlowInstanceId flowInstanceId = null) : this(managerId, actionName, requestId, flowInstanceId)
 {
     TargetActor = targetActor;
 }