Active IQ Unified Manager Discussions

Adapter "0d" resolved as d

mmodi
5,807 Views

Can you please help resolve something that seems like an issue with WFA?

  • Am using SQL user input to select a FCP adapter “0d” passed as a parameter to the finder
    • It seems to resolve “0c” fine but “0d” resolves as d

The certified workflow “Create and configure SAN Storage Virtual Machine” and its finder works fine but it does not take “FCP Adapter by Name” as an input.

Thanks

Modi

8 REPLIES 8

sinhaa
5,731 Views

Modi,

      I don't as yet know why is this happening but I can tell you how to get out of it and proceed.

Since your User-Input for parameter : FCP_TARGET_PORT_1 and FCP_TARGET_PORT_1 do not have "Lock Values" checked, you can select 0d from drop-down list and add double quotes to it like "0d". This should work fine to go ahead.

If this post resolved your issue, help others by selecting ACCEPT AS SOLUTION or adding a KUDO.

mmodi
5,731 Views

I understand that string and constants work but we should have the ability for users to select a fcp adapter from an sql input query.

Sent from my mobile.

sinhaa
5,731 Views

This is not a WFA error. WFA user inputs are in MVEL. and 0d is in MVEL translate to 0 double which is an invalid double type. If you give 1d it will transform as 1.0 . Similarly there are other MVEL literal types Float, like 4.5f , 104.39484B as BigDecimal or 10.4I for big Int

Read more here: http://mvel.codehaus.org/MVEL+2.0+Literals

So this is expected behaviour. So if you want to proceed, use double quotes.

sinhaa

If this post resolved your issue, help others by selecting ACCEPT AS SOLUTION or adding a KUDO.

ktim
5,731 Views

I disagree that this is not a WFA issue. Surely a string user input should always be interpreted as a literal string?

There are some examples showing the messiness of string parameter interpretation. It doesn't behave the same as normal MVEL expressions:

"1" => 1

"1"+"2" => 12

1+2 => 1+2

"1"+2 => "1"+2

0d => <error: For input string "d">

"1"#"2" => <error: java.lang.String cannot be cast to java.lang.Integer>

0d 0d =>. 0d 0d

We shouldn't be expecting workflow end-users to understand MVEL, particularly MVEL that's not really MVEL.

sinhaa
5,731 Views

@Surely a string user input should always be interpreted as a literal string?

-------------

A string user input is not strictly a string unless provided in double/single quotes. Provide double/single quotes and they will all behave as strings. There input parameters at workflow are MVEL enabled inputs and not strings.

@There are some examples showing the messiness of string parameter interpretation. It doesn't behave the same as normal MVEL expressions:

----------

Can you please post what is the correct MVEL behavior at each example you have posted.


@ We shouldn't be expecting workflow end-users to understand MVEL, particularly MVEL that's not really MVEL.

----

WFA2.2  has added feature to provide MVEL help link at every designer item. Open any designer item and click (?) to find the link "Learn about MVEL".

Not really MVEL? Can you elaborate why?

 

If this post resolved your issue, help others by selecting ACCEPT AS SOLUTION or adding a KUDO.

ktim
5,731 Views

@sinhaa, it's fine for strings inside the workflow designer to be MVEL - that's for developers. These are user input strings presented to end users. While we provide a "Learn about MVEL" link on each user input dialog, the attached help does not indicate that user input fields are MVEL enabled... it says "Several fields in OnCommand Workflow Automation (WFA) are enabled for MVFLEX Expression Language (MVEL). You can use MVEL syntaxes in these fields while designing workflows". (No mention of "when providing workflow parameters).

I don't know what possible value could be derived from putting an expression into an user input field. Is anyone in the field using this? Do we really want every parameter query that could possibly include something that might be parsable as an MVEL expression to quote/escape that?

Some examples, comparing user input field translation with regular field translation:

1+2 : UserInput: 1+2   RegularMVEL: 3

"1"+2: UserInput: "1"+2 RegularMVEL: 12

1+(int)"2": UserInput: 1+(int)"2"  RegularMVEL: 3

ab+c: UserInput: ab+c RegularMVEL: <error - Failed to resolve expression 'ab+c'>

"1"+"2" : UserInput: 12  RegularMVEL: 12

I guess we have a solution to Modi's problem - add quotes to the query SQL output:

SELECT

    distinct CONCAT("'",fcp_adapter.name,"'") AS fcp_adapter

FROM

    cm_storage.fcp_adapter,

    cm_storage.cluster

WHERE

    fcp_adapter.status = 'online'

    AND cluster.name = '${PrimaryCluster}'

mmodi
5,731 Views

Thanks Tim, this solutions works great.

sinhaa
5,731 Views

You've raised some very good questions Tim. WFA team will discuss on those and try to resolve them. It could take some time.

Thanks Modi for bringing up an important issue.

sinhaa

WFA

If this post resolved your issue, help others by selecting ACCEPT AS SOLUTION or adding a KUDO.
Public