Skip to content

Fix multiline case statement - #1

Open
cykl wants to merge 2 commits into
iprovalo:masterfrom
cykl:master
Open

Fix multiline case statement#1
cykl wants to merge 2 commits into
iprovalo:masterfrom
cykl:master

Conversation

@cykl

@cykl cykl commented Mar 5, 2013

Copy link
Copy Markdown

Oozie users usually write case statement as follows:

<switch>
            <case to="foo">
                ${wf:actionData('bar')['baz'] == 1} 
            </case>             
            <default to="join"/>
        </switch>

A such entry lead vizoozie to generate an invalid DOT file. This pull request fix this issue. I decided to join all the lines since I never saw a huge EL expression in a case statement.

cykl added 2 commits March 5, 2013 15:23
An Oozie case statement can be multiline and even with simple expression users
often put the el expression on its own line. If not handled carrefully it leads to
an invalid file. Indeed, the DOT language specifies that a double-quoted string
"allows single logical lines to span multiple physical lines using the standard
C convention of a backslash immediately preceding a newline character."

Usually EL expressions are short enough to be merged as a single line. If
required we can use a more sophisticated algorithm to decide if the lines
should be joined or not.
Even if the DOT language specification says that the ID after (di)graph is
optional, some tools like dotty crash if ID is ommited.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant