Skip to main content
Question

Failure of Server Workspace Run not signaled back to submitting workspace

  • May 3, 2018
  • 1 reply
  • 5 views

dollargis
Contributor
Forum|alt.badge.img+1

I have a very simple server workspace copying a table from one database to another using the dynamic workflow:

This workspace is uploaded on the server and gets triggered from a job submitting workspace in FME desktop:

which should signal success or failure through messages.

Strange enough, when I submit a non existing table to be copied, the submitter signals success, while the server log shows:

Error executing SQL command ('select * from "gsm"."odt99" where false limit 0'): 'ERROR: relation "gsm.odt99" does not exist

What is wrong here?

Or, more precisely, how can I get such an error reported back to the job submitter?

1 reply

takashi
Contributor
Forum|alt.badge.img+19
  • Contributor
  • May 5, 2018

Hi @dollargis, I was able to reproduce the same situation as yours. I feel it's strange that FME would consider the translation has succeeded even if the reader failed.

A workaround I can think of is, to determine if the specified table exists with a SQL statement (SQLCreator or SQLExecutor), and then abort (i.e. force failure) the translation with a Terminator if the table didn't exist.

For example, this SQL statement for PostgreSQL/PostGIS database returns t (true) if specified table exists, f (false) otherwise. Assuming that schema name and table name are specified through user parameters called SCHEMA and TABLE. If you execute this statement with a SQLCreator/Executer, it outputs a feature contains an attribute called exists which stores t or f.

select exists (
    select * 
    from information_schema.tables 
    where table_schema = '$(SCHEMA)'
        and table_name = '$(TABLE)'
)

0684Q00000ArK8wQAF.png


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings