Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
find the Teamsite User logged in
kpsadan
I use an external task, which has to
compare the user logged into teamsite with the task owner
. Using the GetOwner() function of WFtask.pm I am able to find the task owner value. Is there any CLT or workaround to get the
user who has logged into Teamsite.
Find more posts tagged with
Comments
Nicholas
I think, iw_user
kpsadan
iw_user returns the workflow owner value.
Nicholas
sorry, just check CLT iwuser (not iw_user)
iw_store
<%@ page language="java" contentType="text/html; charset=UTF-8"%>
<%@ page import="com.interwoven.cssdk.common.CSClient" %>
<%@ page import="com.interwoven.cssdk.access.CSUser" %>
<html>
<head>
<title>Current User Information</title>
</head>
<body>
<%
CSClient client = (CSClient)request.getAttribute("iw.csclient");
String role = client.getCurrentRole();
// Gets the current user
CSUser user = client.getCurrentUser();
%>
Welcome <i><u><%= user.getName() %></u></i>!
<BR>You are logged in with the role <i><u><%= role %></u></i> on server <i><u><%= client.getContext().getServerName()%></u></i>.
</body>
</html>
This may Help you, but it is a JSP file.
kpsadan
How to acheive the same in perl.
I tried `/usr/ucb/whoami`. It is giving task owner value. But in cgitask it is giving the expected value.
iw_store
Hi,
i don't know in perl, i used this jsp file while custamizing STD GUI.
San.
Adam Stoller
I don't believe your requirements, as stated, make any sense in terms of the purpose of an externaltask.
An externaltask is run by the task owner without respect to anyone being logged in.
A cgitask is run by the task owner only when they are logged in.
If you want to compare the job owner to the task owner - that would work.
If you want to compare the task owner to some specific user or set of users - that would work.
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
kpsadan
I have a workflow that contains 5 different task(that includes 4 approval task). Workflow owner can do all the tasks(all the approval tasks). I want to restrict him from doing more than one approval task.
For that purpose I am using an external task to check the teamsite user (workflow owner or task owner), has approved any task before.
If I am using a cgitask I am able to get the value of teamsite user by using the command '/usr/ucb/whoami'. But when I am using the same command in the external task, always I am getting the taskowner value. So I am not able to compare the user value with the previous user values.
Adam Stoller
I have a workflow that contains 5 different task(that includes 4 approval task). Workflow owner can do all the tasks(all the approval tasks). I want to restrict him from doing more than one approval task.
I take it that these approval tasks are grouptasks - yes?
How are they shared - by OS group or individual user lists?
I could see a good Feature Request coming out of this (the ability to specify exclusions to sharedby elements) but the only way I can think of to do this would involve something like this:
review task (as described above)
Set a job variable indicating that job owner has performed a review.
Transition to next review task2nd review taskexternaltask:
Check to see if job variable indicates job owner has already taken ownership of a review task
...
3rd review taskexternaltask ...4th review taskYou'd probably want to use TeamSite::WFtask's
GetSharedBy(\
@users
, \
@groups)
,
RemoveUser($user)
,
AddUser($user)
, and
RemoveGroup($group)
methods. You might simplify things by converting the groups to sets of users before any of the review tasks have been encountered so that you'd only have to use the
RemoveUser($user)
method in your filtering tasks.
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
kpsadan
I take it that these approval tasks are grouptasks - yes?
How are they shared - by OS group or individual user lists?
No, It is not a grouptask. Those are all individual tasks.
They are not shared by any OS group. They are individual users.
The logic I have used is, when ever a user approves, the user name will be stored in a workflow variable. Next time the user approves, the variable user value will be compared with the login user. If username exists in the variable, it will not allow him to approve the task.
Adam Stoller
Okay - you lost me here.
I think you need to provide a detailed description of the workflow task-types and transitions, and what you are attempting to do - because it sounds to me like you're trying to do something that doesn't make any sense and that could be resolved by re-designing the workflow entirely.
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
kpsadan
The requirement is simple. I would like to get the value of Teamsite user who has logged in for the task. iw_user will give the workflow owner value and iw_owner will give the task owner value. The same way I would like to get the user who has logged in for the task.
Adam Stoller
The requirement is NOT simple because an externaltask runs WITHOUT anyone being logged in - it is intended as a fully automated task that has an "owner" but does not require, in any way, shape or form, someone to be logged in, in order for it to run.
A usertask (for review) is predefined as having an owner. You could use an externaltask to re-set that owner to someone else - but the externaltask could only base its decision on [what is loosly termed] the workflow audit trail - and NOT based on who is logged in at any particular point in time (TeamSite is stateless, there is no sense of users being logged in or logged out).
While it is *possible* that the proposal I made earlier when I thought you were working with grouptasks might be able to function in some way close to what you want, I suggest you re-think your design / re-read your requirements to find a better / cleaner / more workable solution.
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com