예제 #1
0
파일: Program.cs 프로젝트: lulzzz/daipan
        static void Main(string[] args)
        {
            IInitializeWFParams actor  = ActorProxy.Create <IInitializeWFParams>(ActorId.CreateRandom(), new Uri("fabric:/Zellenfertigung_Demo/InitializeWFParamsActorService"));
            Task <string>       retval = actor.GetHelloWorldInitAsync();

            Console.WriteLine($"Hello World! {retval.Result}");

            IGetGantryJob getGantryJobActor = ActorProxy.Create <IGetGantryJob>(ActorId.CreateRandom(), new Uri("fabric:/Zellenfertigung_Demo/GetGantryJobActorService"));
            Task <string> GantryJobRetVal   = getGantryJobActor.GetHelloWorldGantryJobAsync(retval.Result);

            Console.WriteLine($"Hello World! {GantryJobRetVal.Result}");

            //IMyService helloWorldClient = ServiceProxy.Create<IMyService>(new Uri("fabric:/Zellenfertigung_Demo/Stateless1"));

            //var message = helloWorldClient.HelloWorldAsync();
            //Console.WriteLine($"Hello World von StatelessService {message.Result }");
            Console.ReadKey();
        }
예제 #2
0
        public override void Run(System.Threading.CancellationToken token, object state, object parameterDto = null)
        {
            if (!token.IsCancellationRequested)
            {
                var s = state as FertigungszelleWorkflowState;
                StateToken = s;

                IGetGantryJob getGantryJobActor = ActorProxy.Create <IGetGantryJob>(ActorId.CreateRandom(), new Uri("fabric:/Zellenfertigung_Demo/GetGantryJobActorService"));
                Task <string> GantryJobRetVal   = getGantryJobActor.GetHelloWorldGantryJobAsync(s.Test);
                Console.WriteLine($"Hello World! {GantryJobRetVal.Result}");
            }
            else
            {
                Core.Logger.InfoFormat($"Fertigungszelle has been canceled by user");
            }
            FinishActivity();
            //FinishActivityAsSuccess(false);
        }