on 04-16-2008 10:09 AM
Hello,
Is there a possibility to automatically start an action ?
there is the following scenario:
A user navigates to my modeled composite view.
I identify the user by the user data control.
I use a service to get application specific information about the user from the backend and save it in the data store.
Depending on this data it should be executed one of two services.(realized with the switch operator).
I trigger the relevant services with a button.
How do I trigger the relevant service automatically ?
I don´t want that the user have to trigger a button, it would be better if this could happen automatically.
How can this be done?
Regards,
Michael
Hi Michael,
In order to model the application you describe, in which the execution flow begins automatically, a start point should be used. Any mappings (or flows) that originate in a start point are executed immediately when the component is loaded. So in your case, the start point should be connected to the in ports of the two services.
I don't think a switch operator will be useful here - the switch operator is meant to allow multiple record sets (with similar meta data) to be displayed in the same UI element. Instead, try using guard conditions on the two mappings from the start point to your services. These guard conditions should be able to reference the relevant fields in the user data connector in order to decide which service gets used. Make sure these conditions are mutually exclusive, or both mappings will be carried out and one will overwrite the other.
Good luck!
Eyal
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Eyal,
I tried but it doesn´t work so far.
So I make a little test scenario to get into this guard condition thing.
I have one start point connected with 2 Services. One service need input, the other doesn´t.
In the start point I defined one Field with a static input for the first service.
When I set the guard condition to the first service to false and the condition to the second service to true all works fine.
But if I change and set the guard condition to the first service to true and to the second service to false I get results from both services.
I have an idea that this could depend on that one service needs input and the other doesn´t.
So I´ve made another test.
I have 2 start point´s each for every service. As above one service needs input the other doesn´t.
I set the guard condition for both start points to false.
The service which doesn´t need input delivers results anyway. It doesn´t matter if the guard condition is true or false.
Is there an reason for this behavior ?
Unfortunatly in my example I described in the first post this case is also given.
I also have a second question:
I need data from the data store instead of user data. But when I use a start point to trigger the services my data store (I think) is not filled with data yet. So I think the guard condition would be always false.
So how can I handle such a problem.
I hope you can help me with all that!
Model:http://img148.imageshack.us/img148/8259/testmodellf5.png
Result:http://img252.imageshack.us/img252/2622/testresultoi2.png
Many thanks and regards,
Michael
Hi Michael,
I wasn't able to replicate your results with guard conditions - they seemed to be working fine for me. One thing that occurred to me was that maybe we are working on different versions - I'm using SP5 - are you?
As for your second question - can you describe the flow you're trying to achieve? What I understand is this:
1) start point -> first service, using user data for input
2) map data to data store
and at the same time
activate second service (one of two, based on variable being stored in the data store)
3) display results of service in step (2) in view
Is that right?
In order to do that, you can try putting a guard condition on the flow from the first service to the second service, based on the same value that you're mapping into the data store. (This, of course, is assuming the guard conditions work properly)
I hope this helps.
Eyal
Hi Eyal,
I am using SP3 so maybe the problem with the guard condition is only in SP3.
Referring my second question your description of the flow was right and I also think that this would work if the guard conditions operate correct.
I hope that I can try this soon with SP5. I post again after I tried.
Many thanks so far.
Regards,
Michael
User | Count |
---|---|
83 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.