Subscribe
Accepted Solution

WFA - Using Conditional Command

Hi All,

 

I'm trying to implement a conditional command using an attribute which is not part of the original dictionary of "Aggregate(cm_storage)".

 

In details:

I want that a variable (lets call it 'aggr1') will have more attributes - for example: "VSMtoLP" , and then I will use it as an advanced condition on one of my other commands in the workflow 
(for example: If the following Expression is TRUE:   aggr1.VSMtoLP == 1)

 

I'm searching the aggr1 variable using some certified filters and some customized filters.

 

Thanks in advance,

 

Roi ecinda.

Re: WFA - Using Conditional Command

If the extra attribute that you wish to add can be returned from a sql query then there is an easy way to do this. 

 

For example this is the Aggregate Filter query that returns the extra attribute 'vsmtolp' 

 

SELECT
    aggr.name,
    node.name AS 'node.name',
    cluster.primary_address AS 'node.cluster.primary_address' ,
    aggr.available_size_mb,
    1 AS 'vsmtolp'
FROM
    cm_storage.aggregate AS aggr
JOIN
    cm_storage.node AS node
        ON aggr.node_id=node.id
JOIN
    cm_storage.cluster AS cluster
        ON node.cluster_id =cluster.id
WHERE
    aggr.block_type = '${block_type}'

 

You can now create a Finder using this filter and add the attribute 'vsmtolp' as a return attribute for the finder. After you have done this it should be possible for you to use the expression "aggregate1.vsmtolp == 1" in the advanced tab of another command

Re: WFA - Using Conditional Command

Thaks alot for your quick response!

 

is there a way doing it without a Finder? just using a filter?

 

 

Re: WFA - Using Conditional Command

That is possible too. In the resource selection dialog once you select your filter, go to the advance tab and change the sorting for your attribute 'vsmtolp' to either ASCENDING or DESCENDING

Re: WFA - Using Conditional Command

Works like a charm!

thank you Smiley Happy