Beispiel #1
0
            private static Task <ActivityResponse> GenericTypeReturnType(ActivityExecutionMethod targetMethod, object targetInstance, object[] parameters, string taskToken)
            {
                var result = targetMethod.Execute(targetInstance, parameters);

                if (result.Primitive())
                {
                    return(Task.FromResult((ActivityResponse) new ActivityCompletedResponse(result.ToString())));
                }

                return(Task.FromResult((ActivityResponse) new ActivityCompletedResponse(result.ToJson())));
            }
Beispiel #2
0
            private static async Task <ActivityResponse> TaskOfGenericTypeReturnType(ActivityExecutionMethod targetMethod, object targetInstance, object[] parameters, string taskToken)
            {
                var   task = (Task)targetMethod.Execute(targetInstance, parameters);
                await task;
                var   result = task.GetType().GetProperty("Result").GetValue(task);

                if (result.Primitive())
                {
                    return(new ActivityCompletedResponse(result.ToString()));
                }
                return(new ActivityCompletedResponse(result.ToJson()));
            }
Beispiel #3
0
 public async Task <ActivityResponse> Execute(ActivityExecutionMethod activityExecutionMethod, object targetInstance, object[] parameters, string taskToken)
 {
     return(await _activityMethod(activityExecutionMethod, targetInstance, parameters, taskToken));
 }
Beispiel #4
0
 private static async Task <ActivityResponse> TaskOfActivityResponseReturnType(ActivityExecutionMethod targetMethod, object targetInstance, object[] parameters, string taskToken)
 {
     return(await(Task <ActivityResponse>) targetMethod.Execute(targetInstance, parameters));
 }
Beispiel #5
0
 private static Task <ActivityResponse> ActivityResponseReturnType(ActivityExecutionMethod targetMethod, object targetInstance, object[] parameters, string taskToken)
 {
     return(Task.FromResult((ActivityResponse)targetMethod.Execute(targetInstance, parameters)));
 }
Beispiel #6
0
 protected Activity()
 {
     _executionMethod = new ActivityExecutionMethod(GetType());
     ConfigureHeartbeat();
     FailOnException = true;
 }