cancel
Showing results for 
Search instead for 
Did you mean: 

How to use switch condition in XMII??

Former Member
0 Kudos

Hi ,

I am not able to find the output path for the match values of switch statement.

Please explain in detail.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Sheetal,

For Switch Action there wont be outgoing links because in switch block it will just check the condition and transfer the flow to appropriate logic.It cant assign a value from outgoing links.

Regards,

Ravi Kumar

Former Member
0 Kudos

Ok fine.. but how to assign the path for respective match.

i'm unable to link it.

Former Member
0 Kudos

Hi,

As i had mentioned in other post. Under Match values you need to give predefined values as we do in actual coding

switch(variable)

case 1:

do blah blah blah

break;

case 2:

do something other

break;

default:

default code to be executed

Here 1,2 in cases are nothing but match values for values obtained from expression given under InputValue in switch action block of xMII.It is not for mapping paths.

Regards,

Ravi Kumar

Former Member
0 Kudos

Hi Ravi,

The values are set to the match value 1,2 and 3 's expression as "A","B" and "C" respectively.

Where should we write the conditional logic like if its A -- the logic what we should need to perform.

Thx

Ravi

Former Member
0 Kudos

Hi Supriya,

Under InputValue in switch action block you need to map the variable to be compared.You can even define expression there like a*(b+c). No need to give condition in switch action.It will automatically take the evaluated InputValue and compare with various matchvalues and execute the respective logic after that.

Regards,

Ravi Kumar.

Former Member
0 Kudos

Hi

After setting the conditions in switch action, add blocks just after switch action depending upon the match values you had set.

If you had given matchvalue1,matchvalue2,matchvalue3 then add three blocks after switch action and do the logic.If matchvalue2 gets true it will go to second branch from switch action and it will execute the respective logic.

You can also define a default branch after switch like we do in actual switch condition in various languages by adding one more branch than no. of match values just after switch action.Here in fourth branch after switch action you will get default branch.If all conditions fail then it will go to this branch.

Regards,

Ravi Kumar

Former Member
0 Kudos

Here in these branches u need to use different formulas for getting diff results.After that map the output to a xml transaction variable in each branch.And in the page you map the output of the transaction with ichart display template.

Former Member
0 Kudos

Hi Ravi,

What should be my three branches means which action block i should use to do my switch logic. I should add three sequences to the switch block and which block should be used for that.

thx

supriya

Former Member
0 Kudos

Hi Ravi,

I added 3 inputs by using configure button of switch action->results 3 matchvalues.

After that i placed the condition in each MatchValue expression by mapping it to the Repeater output variable on which i written the condition in above expression.

first sqlquery--> xMII xml document --> Repeater --> switch

And i did the calculation after switch by using assignment and row.

but after executing the above transaction in the output trace it is entering into repeater and switch but it is not entering into sequences after switch.

But it is repeating switch based on the number of rows of output by using repeater

Means some problem with switch can u pease clarify it

after adding the condition for each match value i added 3 sequences below that switch and there i had used assignment action to assign the value from repeater which has to be calculated to transaction variable.

then i had used xMII xml row and i am getting the values from transaction and repeater and i am configuring this row to document output which i used above repeater.

Former Member
0 Kudos

The conditions for match values in switch are as follows

Target xpath: Switch_0.MatchValue1

Expression: Repeater_0.Output{/Row/prod}=="A"

Like this i had given for match values and the input value under switch for what i am not getting

Former Member
0 Kudos

Hi Ravi,

Now i am getting the values and they are passing through the switch and they are coming to the respective actions under switch

Thanks a lot for helping to answer this question

Former Member
0 Kudos

Hi Ravi,

No ravi it is not working it is giving all values in xML saver without testing any condition.

please help me out in this issue.........

Former Member
0 Kudos

Hi Ravi,

No ravi it is not working it is giving all values in xML saver without testing any condition.

please help me out in this issue.........

Ravi i clicked the above messages in response to my message only please go through the above thread and help me in resolving this issue

Former Member
0 Kudos

Hi Rajesh,

Insert a tracer after the repeater and check the value.

If yes then check the switch condition.

If no switch condition matched give some message in the fourth branch. I think you are using only three matching values. So by default the fouth branch is the one which will be executed if nothing matches.

Check this,

kishore

Former Member
0 Kudos

Hi Rajesh,

Had ur problem got solved...?

Former Member
0 Kudos

Hi Kishore,

Now it is working fine, i had given input value as a parameter on which i have to write condition

and in the matchvalues i had given the expected values--cases and it is working fine, thanks a lot for suggesting us to resolve the problem.

switch(inputvalue)

{

case matchvalue1: code;

case matchvalue2: code;

case matchvalue3: code;

}

Former Member
0 Kudos

Hi Ravi,

my problem got solved thanks a lot for guideing us in resolving the problem

Former Member
0 Kudos

Hi rajesh,

once your problem is solved make this thread as a answered one.

Regards,

Kishore