on 08-29-2007 8:49 AM
Hi ,
I am not able to find the output path for the match values of switch statement.
Please explain in detail.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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.
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
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.
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
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;
}
User | Count |
---|---|
11 | |
6 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.