spacer
cornerspacercorner
Reply
Advisor
SundeepD
Posts: 25
Registered: 08-19-2011
0 Kudos
Accepted Solution

How to assign a folder to particular user dynamically

Hi,

 

Could any one suggest me how to assign a folder to user dynamically depending on the value fetched from database..

 

Thanks in advance

Sundeep

 

 

Valued Contributor
Paul
Posts: 145
Registered: 05-19-2010
0 Kudos

Re: How to assign a folder to particular user dynamically

You need to use a dynamic role.  Define a new role and set the formula to whatever you need - so if you need a database value it is likely to be a select statement (Metastorm formula of course).  Just beware that your formula needs to return a List of Metastorm user names.

 

Hope this helps.

Advisor
TKLam
Posts: 13
Registered: 06-03-2010
0 Kudos

Re: How to assign a folder to particular user dynamically

What Paul stated but you will need to enable Dynamic role.  I believe by default Metastorm installs with dynamic role disable.

Advisor
SundeepD
Posts: 25
Registered: 08-19-2011
0 Kudos

Re: How to assign a folder to particular user dynamically

Hi Paul,

 

As per your suggestion i have created Dynamic Role using the below formula.

 

SelectSql(

new RoleManagement_DBConnection(),"SELECT Manager FROM (select Manager , ROW_NUMBER()OVER(ORDER BY PortfolioManager DESC) AS RowNumber from Resources_Data where Resource_Status='Yes' group by Manager ) as t1 where t1.RowNumber=2;")

 

In the Formula Tab of the Role creation.

Above query fetches the one record which is name of the Manager. For Example consider 'sundeep' is fetched from that record.

 

I have already created a user with name 'sundeep'. Also for your information i am using flag  from another process to create the task.

 

I was expecting that task which ever was created using flag will be visible to only sundeep.

 

 

Status: i am able to see 2 outputs after implementing this

 

1. I am able to see the case from all users

2. Though the case was created I am not able to see the case with any user.

 

 

could you please suggest where i am going wrong and also could you please tell me what should i do to enable dynamic roles in metastorm.

Advisor
SundeepD
Posts: 25
Registered: 08-19-2011
0 Kudos

Re: How to assign a folder to particular user dynamically

could you please tell me how should i enable the dynamic roles in metastorm ?
Valued Contributor
Paul
Posts: 145
Registered: 05-19-2010
0 Kudos

Re: How to assign a folder to particular user dynamically

You must return a list from your SQL statement so you will need to use .List

 

Remember that ToDo and Watch list are calculated when a folder hits a stage so if your folder was already at a stage creating new or modifies roles will not add entries to these lists.

Valued Contributor
Paul
Posts: 145
Registered: 05-19-2010
0 Kudos

Re: How to assign a folder to particular user dynamically

You do not need to enable dynamic roles.

Advisor
SundeepD
Posts: 25
Registered: 08-19-2011
0 Kudos

Re: How to assign a folder to particular user dynamically

[ Edited ]

Hi Paul,

Thanks for you quick reply.

Could you please provide more information on the details you have provided..

I did the following after seein your post :

It worked when i used ListItems function in the roles formula ,which is provided out of box by Metastorm and entered the user name in quotes.
But when i entered the sql statement to get the value dynamically from db using the select statement it is not taking that value.

As per my knowledge , the select statement will return the data in the form of list, if not could you please let me know how can i get the data from db in the LIST form.

appreciate if you can provide an example for getting the data in list form using any simple select query.

 

Added the screen shots of both the scenarios discussed above.

Thanks in Advance.

Valued Contributor
Paul
Posts: 145
Registered: 05-19-2010

Re: How to assign a folder to particular user dynamically

try this....  SelectSql(new myConnection(),mySQLStatement).List

Advisor
SundeepD
Posts: 25
Registered: 08-19-2011
0 Kudos

Re: How to assign a folder to particular user dynamically

Thanks Paul,,

 

 

It worked.

 

 

line spacer line
spacerFollow Metastorm on:
spacer Twitter YouTube Blog iTunes LinkedIn Metastorm Community Central, MC2
spacer Copyright © 2011 OpenText Corporation. All Rights Reserved.spacer About Metastormspacer Privacyspacer Legalspacer Site Mapspacer RSSspacer Contact Us
Microsoft Gold Certified Partner
Powered by Windows Azure
line spacer line