Home
Content Management (Extended ECM)
API, SDK, REST and Web Services
WebLingo UAPI OScript
Greg_Griffiths_(greggriffiths_-_(deleted))
Dear All,I'm trying to do the following on a WebLingo page :1. Given an ID determine if it is a Group or a User2. If it is a group get a count of the number of User/Groups in the group.3. If there is only a single User in that group set a boolean.Can anyone assist with the OScript ?
Find more posts tagged with
Comments
Howard_Pell
Message from Howard Pell <
hlpell@opentext.com
> via eLink
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">eLink
Greg,
To get info about a user/group you can use UAPI.GetByID and test the return record to see if it is a user or a group.
If you find a group then you can use UAPI.ChildrenListByID to get all the children of that group. Set your Boolean to false, then for each child in the group, test to see if it is a user. When you find the first user set the Boolean to true, and as soon as you count user number 2, set your Boolean to false and exit the loop.
Does that help?
Howard
Howard Pell
Senior Technical Educator
Liaison, Special Projects
Open Text Corporation
www.opentext.com
(519) 888-7111 Ext. 2203
Education is for improving the lives of others and for leaving your community and world better than you found it.
- Marian Wright Edelman
From:
eLink Discussion: Development Discussion [mailto:development@elinkkc.opentext.com]
Sent:
Friday, April 15, 2005 6:03 AM
To:
eLink Recipient
Subject:
WebLingo UAPI OScript
WebLingo UAPI OScript
Posted by
DIVLEV
(Griffiths, Greg) on 04/15/2005 06:02 AM
Dear All,
I'm trying to do the following on a WebLingo page :
1. Given an ID determine if it is a Group or a User
2. If it is a group get a count of the number of User/Groups in the group.
3. If there is only a single User in that group set a boolean.
Can anyone assist with the OScript ?
Greg_Griffiths_(greggriffiths_-_(deleted))
I'm actually trying to amend the WEBWORK\TGENERICFRAME.HTML file such that if the task is assigned to a group that contains a single user then reassign the task to that user. This code is going in just after the variables are populated and correctly avoids the group 'if' statement in the code, but for some reason the Task Completor in the WF Status Map View is shown as the group and not the user, any ideas what else I need to change ?Object prgCtx1 = Undefinedif (Os.IsFeature( this, "fPrgCtx" ) ) prgCtx1 = .fPrgCtxend // ifif ( IsDefined( prgCtx1 ) && IsNotError( prgCtx1 ) ) Dynamic userObject = prgCtx1.USession() if ( IsDefined( userObject ) && IsNotError( userObject ) ) UAPISession uapiSession = userObject.fSession if ( IsDefined( uapiSession ) && IsNotError( uapiSession ) ) RecArray userInfo = UAPI.GetByID( uapiSession, taskInfo.SUBWORKTASK_PERFORMERID ) if ( IsDefined( userInfo ) && IsNotError( userInfo ) ) String userType = Str.String(userInfo[1].Type) if (userType=="1") RecArray groupMembers=UAPI.ChildrenListByID(uapiSession,userInfo[1].Id) Integer groupMembersLength=Length(groupMembers) if ((groupMembersLength==1) && (groupMembers[1].Type==UAPI.USER)) taskData.GroupStep=False taskInfo.SUBWORKTASK_PERFORMERID=.fPrgCtx.fUSession.fUserId end end end end endend
Vinayak_Muzumdar_(vinayakmuzumdar_-_(deleted))
my thought..Instead of changing the core files. you can write a simple performer callback script where you will check whether it there is only one user in it or not. If YES then return the user ID otherwise return the group ID.Is it not OKRegards
Greg_Griffiths_(greggriffiths_-_(deleted))
I finally got this sorted, by getting the WebLingo to output some JS to call the accept task button's event progamatically. This now works for all workflow steps on the server, which is what I needed.Vinayak, can you provide some more detaili on your call back script idea, I'd be interested to see how that would compare.