Last activity: 3 Oct 2018 15:27 EDT
Solution for Datapage
I have a requirement to pass the value of token to api.On application loading,we are calling an authentication activity and we are storing the value of token on a page.The value of property in page is being passed to Datapage at requestor level which is readonly page.when datapage is getting stale,it is unable to fetch the value as we have created a datatransform where it is trying to fetch value from same page.The property is not retaining the value in page.What should be the approach and what should be reload strategy for datapage.The token is valid for 12 hrs.
***Updated by moderator: Lochan to update platform capability***
You can follow below steps.
1. Create requestor datapage with refresh strategy of 12 hours.
2. Create load activity which will call authentication service and set the value in datapage.
3. Refer datapage in application profile setup to use on application load.
4. You can reuse this later.
5. If datapage is stale it will reload by calling load activity.
So need to copy to temporary page.
1.In application profile setup, authentication activity is getting called which is calling datapage.
2.After 12 hrs anyways user will have to relogin in order to fetch token as its happening on when user tries to login.
3.Currentlly I was using datatransform in authentication activity which will call datapage and when datapage is stale it will load from temp page.
But now if we can directly store on datapage and apply refresh strategy of 12 hrs.After 12 hrs what logic should we give in load activity as auth activity cannot be called from datapage..user has to relogin.
Are you getting token from external system or your generating in application load?. Why you want to hold the token in datapage if it is required only on login?
The token is used in service calls so its needed as its mandatory parameter.
If we give refresh strategy of 12 hrs,is there a possibility that data page will become stale before 12 hrs?
Create editable requestor data page use the dummy datatransform as load activity. Set the value to data page directly in your authentication activity.
Also requestor datapage will not be stale until we log off the session.
If you still have doubt on datapage stale then try to get the token in load activity/datatransform and include the refresh strategy.
You can maintain another requestor level data page that holds the parameter required to your data page. If I understood your requirement correctly, all you need to know the param value for the data page which is known during the authentication process only. So you can copy that on to a requestor level data page during authentication process and use that whenever you need it.
Thats correct.we are saving the value in temp page to datapage during authentication activity.The problem happens when the datapage becomes stale before making api call,then it tries to get the value from temp page again which is loosing the value.If we maintain another datapage for just holding the value,what would be refresh strategy for this page?The token remains valid for 12 hrs.so if we give it for 12 hrs would it work or is there a possibility of loosing the value?
You should not depend on the auto refresh strategy of the data page, instead you should refresh it on your own. During authentication process, load the requestor level DP with the token value and expiration time. This data page won't be expired till you explicitly do it. You can rely on the token value present on the data page as long as the expiration time is not in past before using the token. When you find it is expired, you should find a way to refresh the token.
Even if i am giving it explicitly as 12 hrs in reload if older than,datapage is loosing the value.
For your case, you should expire the DP with your own logic. You don't have to use OOTB reload strategy. Create the data page ,D_TokenInfo (Requestor level editable page hence no expiry, dummy load data transform) to hold the token and its expiration time (this is basically the DP loading timestamp + 12 hours). This page will be set with the token info during the authentication process. Whenever you want it, use another data page like D_FetchAccessToken which reads the token from the data page D_TokenInfo. If the expiration time is in past which means the token is expired, the loading logic of D_FetchAccessToken DP should get the latest AccessToken and place it on D_TokenInfo. This way it will be reused when its valid.
You need different ways of loading D_TokenInfo. One is during the initial authentication process and other one is during expiration. Hope this is helpful.