# How to find active pages and current page in workplace

**URL:** <https://techcommunity.softwareag.com/t/how-to-find-active-pages-and-current-page-in-workplace/57173>\
**Category:** Forum\
**Tags:** Former-Crossvision-Products, Application-Composer\
**Created:** [February 1, 2006, 6:51pm UTC](https://techcommunity.softwareag.com/t/how-to-find-active-pages-and-current-page-in-workplace/57173 "2006-02-01T18:51:26Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Serhat](https://avatars.discourse-cdn.com/v4/letter/s/c0e974/32.png) [@Serhat](https://techcommunity.softwareag.com/u/Serhat)\
**Post date:** [February 1, 2006, 6:51pm UTC](https://techcommunity.softwareag.com/t/how-to-find-active-pages-and-current-page-in-workplace/57173/1 "2006-02-01T18:51:26Z")

</div>

Hello ,  
How can I find active pages and current page in workplace .Also I need functions to close them. My pages are both CAI & HTML pages.

Thanks.

---

<div class="post-metadata">

**Author:** ![Bjoern\_Mueller](https://avatars.discourse-cdn.com/v4/letter/b/e9bcb4/32.png) [@Bjoern\_Mueller](https://techcommunity.softwareag.com/u/Bjoern_Mueller)\
**Post date:** [February 3, 2006, 2:13pm UTC](https://techcommunity.softwareag.com/t/how-to-find-active-pages-and-current-page-in-workplace/57173/2 "2006-02-03T14:13:11Z")

</div>

There is one function with IMWorkplace:

```
/**
 * Checks if the page that is passed via the parameters is 
 * currently displayed inside the content area of the workplace.
 * Example: when switching pages only page switches are passed
 * to the workplace which happen on level of the current content
 * page.
 */
public boolean checkIfPageIsCurrentContentPage(String subSessionId,
                                               String pageName,
                                               String modelId);

```

Does this help you?

For closing pages: use the endProcess() method that by default closes the subsession and removes the page from the workplace.

Bjoern

---

<div class="post-metadata">

**Author:** ![Serhat](https://avatars.discourse-cdn.com/v4/letter/s/c0e974/32.png) [@Serhat](https://techcommunity.softwareag.com/u/Serhat)\
**Post date:** [February 3, 2006, 2:43pm UTC](https://techcommunity.softwareag.com/t/how-to-find-active-pages-and-current-page-in-workplace/57173/3 "2006-02-03T14:43:23Z")

</div>

In my case I have CAI pages , pure html pages and some jsp pages…For CAI pages I can collect active pages and their subsession id’s some how.(By the way I guess there is no standard mechanizm to reach this info). But what can I do for pure html & jsp pages ? Should I always use them as subpages in a CAI page ?

---

<div class="post-metadata">

**Author:** ![Konstantin](https://avatars.discourse-cdn.com/v4/letter/k/858c86/32.png) [@Konstantin](https://techcommunity.softwareag.com/u/Konstantin)\
**Post date:** [April 5, 2006, 8:50pm UTC](https://techcommunity.softwareag.com/t/how-to-find-active-pages-and-current-page-in-workplace/57173/4 "2006-04-05T20:50:56Z")

</div>

Hi there. My question related to that problem is:

If I my workplace looks like this:

\<?xml version="1.0" encoding="UTF-8"?\> 

How can I close that WORKLIST page?  
Somehow, since it is a page with its own subsession I cannot really close that one with the following mechanism:

public void doLogout(){

```
	ArrayList activeGuis;
	String subSessionId;
	IMFWorkplace workplace = (IMFWorkplace)mContext.lookup(IMFWorkplace.IWORKPLACE_LOOKUP, false);
	
	activeGuis = this.getUserSession().getRegisteredGUISessions();
	
	Iterator iter = activeGuis.iterator();
	
	//checkIfPageIsCurrentContentPage(String subSessionId, String pageName, String modelId); 
	
	//Remove all pages from workplace		
	while(iter.hasNext()){
		
		subSessionId = (String)iter.next();
		workplace.removePageFromWorkplace(subSessionId);
		
	}
	
	
	workplace.updateWorkplace(this);		
	this.getUserSession().logout();
	
	//Refresh left function tree
	this.updateFunctionTree();
	this.closePage();
}

```

Any ideas anyone?

---

<div class="post-metadata">

**Author:** ![Serhat](https://avatars.discourse-cdn.com/v4/letter/s/c0e974/32.png) [@Serhat](https://techcommunity.softwareag.com/u/Serhat)\
**Post date:** [April 5, 2006, 9:33pm UTC](https://techcommunity.softwareag.com/t/how-to-find-active-pages-and-current-page-in-workplace/57173/5 "2006-04-05T21:33:05Z")

</div>

If you want to control your pages externally , collecting your adapter infos in their activate methods may work.  
But If you just want to reset your workplace , the codes below makes thinks easier.

```auto

 openPageInTarget("../MyProject/start.jsp","_top");
```

start.jsp (just use it to redirection)

```auto

<%
   response.sendRedirect(request.getContextPath()+"/servlet/StartCISPage?PAGEURL=/MyProject/workplace.html");
 
  
%>
```

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [April 2, 2021, 2:38pm UTC](https://techcommunity.softwareag.com/t/how-to-find-active-pages-and-current-page-in-workplace/57173/6 "2021-04-02T14:38:27Z")

</div>


