Question

How to run FME workspace asyn from C#

  • 2 November 2017
  • 5 replies
  • 21 views

Badge

Hi there,

I can create a C# application syn way although my C# Controller using asyn way follows the sample in FME Playground. So how to create with asyn way using C#? So I can get the fme job# id. By the way, how can I run a workspace using asyn way by login FME Server? Thank you very much.


5 replies

Userlevel 4

There is a pretty good starting point on the FME Server Playground: https://playground.fmeserver.com/csharp-request/

Badge

This is an syn example and only example for C#. This is working for me, but sometimes workspace may run a long time, my C# want to do "fire and forgot", but meanwhile get the FME job id right away for late continues accept messages from a SignalR.

Userlevel 4

I have a slight problem understanding exactly what you need, but the example I linked to on the FME Server Playground is indeed asynchronous, not synchronous.

The code example submits a job to FME Server and prints the job id that it receives at the end of the code example. You can then use this job id to poll for progress, etc. while the job is executed. If you do this in a loop you can also take care of other stuff in your application.

Badge

I have a slight problem understanding exactly what you need, but the example I linked to on the FME Server Playground is indeed asynchronous, not synchronous.

The code example submits a job to FME Server and prints the job id that it receives at the end of the code example. You can then use this job id to poll for progress, etc. while the job is executed. If you do this in a loop you can also take care of other stuff in your application.

I see, my json string is not correct, has to be name value pair.

 

 

Userlevel 4
I see, my json string is not correct, has to be name value pair.

 

 

I really recommend looking at the examples on the FME Server Playground, there is a lot of great resources available there.

 

The most important part, however, is the REST API documentation:

 

V2: https://docs.safe.com/fme/html/FME_REST/v2/apidoc/index.html

 

V3: https://docs.safe.com/fme/html/FME_REST/apidoc/v3/index.html

 

If you're only using FME Server 2017 or later I recommend using the V3.

Reply