To delete/undeploy multiple BPEL processes from BPELConsole (10.1.3.4)
There was some performance issue in Development server due to thousands of unused/junk BPEL processes deployed within the container , but I couldn’t able to delete all at once as there was no option and if deleting one by one could take many hours to perform this , then I found a solution over the net which changes little code of some JSPs of the product ( Although not change in the product code not supported by Oracle). Here is the process to do the same which saved huge amount of hours and work :-
Note :- Replace all "*" with "<" and "#" with ">"
1) Take a backup of the files; bulkUpdateProcess.jsp and doBulkUpdateProcess.jsp.
The path is :-
$ORACLE_HOME/j2ee/oc4j_soa/applications/orabpel/console
2) Add the below code in the the file bulkUpdateProcess.jsp.
(Add the code after the label:
*label for="processStateOff"#
*%= I18nUtil.getString("off", locale)%#
*/label#)
Code to be added :-
----
*p#
*b#Process Undeploy:*/b#*br#
Using this option all the selected processes
can be undeployed at once.
*br# The default for undeployment is *i#*b#none
*/b#*/i#, but you can enable this bulk undeployment
*br# by setting this value to *i#*b#all
*/b#*/i#.*br# Note that if this option is selected,
the other bulk update options (Process Lifecycle/State)
are ignored. *p#
*input type="radio" id="processDeployOff"
name="processDeploy" value="none" checked#
*label for="processDeployOff"#None*/label#
*input type="radio" id="processDeploy"
name="processDeploy" value="all"#
*label for="processDeploy"#All */label#
-----------
3) Replace the whole code in the the file dobulkUpdateProcess.jsp with below code .
doBulkUpdateProcess.jsp is here:
----------
*%@page contentType="text/html; charset=UTF-8" %#
*%@page errorPage="reportError.jsp" %#
*%@page import="com.oracle.bpel.client.*" %#
*%@page import="com.oracle.bpel.client.ServerException" %#
*%@page import="com.oracle.bpel.client.util.*" %#
*%@page import="com.collaxa.cube.util.BuildInfo" %#
*%@page import="com.collaxa.cube.fe.util.ServletUtils" %#
*%@page import="com.collaxa.common.util.*" %#
*%@page import="com.collaxa.cube.rm.suitcase.*" %#
*%@page import="java.text.*" %#
*%@page import="java.util.*" %#
*%@include file="initI18n.jspf" %#
*%
int n0 = 0, n1 = 0;
Locator l = ServletUtils.getLocatorWithoutUrlRewrite(request, response);
request.setAttribute( "tab", "BPEL Processes" );
IBPELDomainHandle domain = l.lookupDomain();
String processIds = request.getParameter( "processIds" );
ArrayList list0 = CXStringUtils.split( processIds, ' ' );
n0 = list0.size();
ArrayList list1 = new ArrayList();
Iterator li = list0.iterator();
try {
String undeployMode = request.getParameter( "processDeploy" );
if (undeployMode.equalsIgnoreCase("all")) {
for( int size = list0.size(); size # 0; size-- )
{
list1.clear();
CXStringUtils.split( (String) li.next(), '~', list1 );
BPELProcessId pid = new BPELProcessId(domain.getDomainId(),
(String)list1.get(0), (String)list1.get(1));
domain.undeployProcess(pid);
n1++;
}
}
else {
int lifecycle = -1;
String processMode = request.getParameter( "processMode" );
if( ! CXStringUtils.isEmpty( processMode ) )
{
lifecycle = "open".equalsIgnoreCase( processMode )
? IBPELProcessConstants.LIFECYCLE_ACTIVE
: IBPELProcessConstants.LIFECYCLE_RETIRED;
}
int state = -1;
String processState = request.getParameter( "processState" );
if( ! CXStringUtils.isEmpty( processState ) )
{
state = "on".equalsIgnoreCase( processState )
? IBPELProcessConstants.STATE_ON
: IBPELProcessConstants.STATE_OFF;
}
for( int size = list0.size(); size # 0; size-- )
{
list1.clear();
CXStringUtils.split( (String) li.next(), '~', list1 );
BPELProcessHandle process = (BPELProcessHandle)
l.lookupProcess( (String) list1.get( 0 ),
(String) list1.get( 1 ) );
BPELProcessMetaData ri = process.getMetaData();
int i = 0;
if( lifecycle != -1 )
{
if( ( ri.isLifecycleActive() &&
lifecycle == IBPELProcessConstants.LIFECYCLE_RETIRED ) ||
( ! ri.isLifecycleActive() &&
lifecycle == IBPELProcessConstants.LIFECYCLE_ACTIVE ) )
{
ri.setLifecycle( lifecycle );
i++;
}
}
if( state != -1 )
{
if( ( ri.isStateOn() &&
state == IBPELProcessConstants.STATE_OFF ) ||
( ! ri.isStateOn() &&
state == IBPELProcessConstants.STATE_ON ) )
{
ri.setState( state );
i++;
}
}
if( i # 0 )
process.updateMetaData( ri );
n1++;
}
}
}
catch( Exception e )
{
e.printStackTrace();
}
%#
*html lang="en-US"#
*style type="text/css"#
*!--
.title {
font-size: 16px;
font-family: Verdana, Arial, Helvetica, sans-serif;
}
.note {
font-size: 12px;
font-family: Verdana, Arial, Helvetica, sans-serif;
}
--#
*/style#
*head#
*title#*%= I18nUtil.getString("title", BuildInfo.getVersion(), locale)%#*/title#
*jsp:include page="ngIncludes.jsp" /#
*/head#
*body bgcolor="#FFFFFF"#
*form action="processes.jsp" method="get"#
*table summary="" class="DefaultTable" cellspacing="0" cellpadding="0"#
*tr height="20"#
*td class="TabPane" colspan="2"#
*jsp:include page="ngTabs.jsp" /#
*/td#
*/tr#
*tr#
*td colspan="2" class="IViewerInstanceInfoPane"#
*table summary="" class="DefaultTable" cellpadding="0" cellspacing="0"#
*tr#
*td valign="middle" style="padding-left:15px"# */td#
*/tr#
*/table#
*/td#
*/tr#
*tr#
*td class="IViewerTabControl"#
*div class="IViewerTabPadding"#*img src="images/iviewer/blank.gif" alt="" border="0" width="1" /#*/div#
*/td#
*td class="IViewerRightPane"#
*table summary="" class="DefaultTable" cellspacing="0" cellpadding="0" width="100%" height="100%"#
*tr#
*td colspan="2" class="SViewerToolViewWrapper"#
*div align="center" style="padding:10px"#
*table width="80%" align="center" border="0" cellspacing="10" cellpadding="0" bgcolor="#f0f0f0"#
*tr#
*td#
*b#*label class="title"#*%= I18nUtil.getString("bulk_update_processes_complete", locale)%#*/label#*/b#
*p#
*label class="note"#
*%= n1 == 1 ? I18nUtil.getString("one_process_updated",
Integer.toString(n1), l.getDomainId(), locale) :
I18nUtil.getString("many_process_updated",
Integer.toString(n1), l.getDomainId(), locale) %#
*%
if( n0 # 0 && n0 != n1 )
{
String mesg = "";
if(n0 == 1 && ((n1 - n0) == 1) )
mesg = I18nUtil.getString("one_process_one_error",
Integer.toString(n0), Integer.toString((n1 - n0)), locale);
if(n0 != 1 && ((n1 - n0) == 1) )
mesg = I18nUtil.getString("many_process_one_error",
Integer.toString(n0), Integer.toString((n1 - n0)), locale);
if(n0 == 1 && ((n1 - n0) != 1) )
mesg = I18nUtil.getString("one_process_many_error",
Integer.toString(n0), Integer.toString((n1 - n0)), locale);
if(n0 != 1 && ((n1 - n0) != 1) )
mesg = I18nUtil.getString("many_process_many_error",
Integer.toString(n0), Integer.toString((n1 - n0)), locale);
%#
*%= mesg%#
*%
}
%#
*/label#
*p#
*div style="text-align:right"#
*input type="submit" name="home" value='*%= I18nUtil.getString("back_to_processes", locale)%#' /#
*/div#
*/td#
*/tr#
*/table#
*/div#
*/td#
*/tr#
*/table#
*/td#
*/tr#
*tr#
*td class="FooterPane" colspan="2"#
*jsp:include page="ngFooter.jsp" /#
*/td#
*/tr#
*/table#
*/form#
*/body#
*/html#
4)
Navigate to the BpelConsole after you above steps, now use the new feature. Select the BpelProcesses you want to undeploy or use the ‘Check_all’ option and press the ‘Bulk update’ button.
Click at the bottom of the page the new ‘Process Undeploy’ option which you can use to undeploy all the selected processes.
5) Check all the selected processes will get undeployed
Note :- Replace all "*" with "<" and "#" with ">"
1) Take a backup of the files; bulkUpdateProcess.jsp and doBulkUpdateProcess.jsp.
The path is :-
$ORACLE_HOME/j2ee/oc4j_soa/applications/orabpel/console
2) Add the below code in the the file bulkUpdateProcess.jsp.
(Add the code after the label:
*label for="processStateOff"#
*%= I18nUtil.getString("off", locale)%#
*/label#)
Code to be added :-
----
*p#
*b#Process Undeploy:*/b#*br#
Using this option all the selected processes
can be undeployed at once.
*br# The default for undeployment is *i#*b#none
*/b#*/i#, but you can enable this bulk undeployment
*br# by setting this value to *i#*b#all
*/b#*/i#.*br# Note that if this option is selected,
the other bulk update options (Process Lifecycle/State)
are ignored. *p#
*input type="radio" id="processDeployOff"
name="processDeploy" value="none" checked#
*label for="processDeployOff"#None*/label#
*input type="radio" id="processDeploy"
name="processDeploy" value="all"#
*label for="processDeploy"#All */label#
-----------
3) Replace the whole code in the the file dobulkUpdateProcess.jsp with below code .
doBulkUpdateProcess.jsp is here:
----------
*%@page contentType="text/html; charset=UTF-8" %#
*%@page errorPage="reportError.jsp" %#
*%@page import="com.oracle.bpel.client.*" %#
*%@page import="com.oracle.bpel.client.ServerException" %#
*%@page import="com.oracle.bpel.client.util.*" %#
*%@page import="com.collaxa.cube.util.BuildInfo" %#
*%@page import="com.collaxa.cube.fe.util.ServletUtils" %#
*%@page import="com.collaxa.common.util.*" %#
*%@page import="com.collaxa.cube.rm.suitcase.*" %#
*%@page import="java.text.*" %#
*%@page import="java.util.*" %#
*%@include file="initI18n.jspf" %#
*%
int n0 = 0, n1 = 0;
Locator l = ServletUtils.getLocatorWithoutUrlRewrite(request, response);
request.setAttribute( "tab", "BPEL Processes" );
IBPELDomainHandle domain = l.lookupDomain();
String processIds = request.getParameter( "processIds" );
ArrayList list0 = CXStringUtils.split( processIds, ' ' );
n0 = list0.size();
ArrayList list1 = new ArrayList();
Iterator li = list0.iterator();
try {
String undeployMode = request.getParameter( "processDeploy" );
if (undeployMode.equalsIgnoreCase("all")) {
for( int size = list0.size(); size # 0; size-- )
{
list1.clear();
CXStringUtils.split( (String) li.next(), '~', list1 );
BPELProcessId pid = new BPELProcessId(domain.getDomainId(),
(String)list1.get(0), (String)list1.get(1));
domain.undeployProcess(pid);
n1++;
}
}
else {
int lifecycle = -1;
String processMode = request.getParameter( "processMode" );
if( ! CXStringUtils.isEmpty( processMode ) )
{
lifecycle = "open".equalsIgnoreCase( processMode )
? IBPELProcessConstants.LIFECYCLE_ACTIVE
: IBPELProcessConstants.LIFECYCLE_RETIRED;
}
int state = -1;
String processState = request.getParameter( "processState" );
if( ! CXStringUtils.isEmpty( processState ) )
{
state = "on".equalsIgnoreCase( processState )
? IBPELProcessConstants.STATE_ON
: IBPELProcessConstants.STATE_OFF;
}
for( int size = list0.size(); size # 0; size-- )
{
list1.clear();
CXStringUtils.split( (String) li.next(), '~', list1 );
BPELProcessHandle process = (BPELProcessHandle)
l.lookupProcess( (String) list1.get( 0 ),
(String) list1.get( 1 ) );
BPELProcessMetaData ri = process.getMetaData();
int i = 0;
if( lifecycle != -1 )
{
if( ( ri.isLifecycleActive() &&
lifecycle == IBPELProcessConstants.LIFECYCLE_RETIRED ) ||
( ! ri.isLifecycleActive() &&
lifecycle == IBPELProcessConstants.LIFECYCLE_ACTIVE ) )
{
ri.setLifecycle( lifecycle );
i++;
}
}
if( state != -1 )
{
if( ( ri.isStateOn() &&
state == IBPELProcessConstants.STATE_OFF ) ||
( ! ri.isStateOn() &&
state == IBPELProcessConstants.STATE_ON ) )
{
ri.setState( state );
i++;
}
}
if( i # 0 )
process.updateMetaData( ri );
n1++;
}
}
}
catch( Exception e )
{
e.printStackTrace();
}
%#
*html lang="en-US"#
*style type="text/css"#
*!--
.title {
font-size: 16px;
font-family: Verdana, Arial, Helvetica, sans-serif;
}
.note {
font-size: 12px;
font-family: Verdana, Arial, Helvetica, sans-serif;
}
--#
*/style#
*head#
*title#*%= I18nUtil.getString("title", BuildInfo.getVersion(), locale)%#*/title#
*jsp:include page="ngIncludes.jsp" /#
*/head#
*body bgcolor="#FFFFFF"#
*form action="processes.jsp" method="get"#
*table summary="" class="DefaultTable" cellspacing="0" cellpadding="0"#
*tr height="20"#
*td class="TabPane" colspan="2"#
*jsp:include page="ngTabs.jsp" /#
*/td#
*/tr#
*tr#
*td colspan="2" class="IViewerInstanceInfoPane"#
*table summary="" class="DefaultTable" cellpadding="0" cellspacing="0"#
*tr#
*td valign="middle" style="padding-left:15px"# */td#
*/tr#
*/table#
*/td#
*/tr#
*tr#
*td class="IViewerTabControl"#
*div class="IViewerTabPadding"#*img src="images/iviewer/blank.gif" alt="" border="0" width="1" /#*/div#
*/td#
*td class="IViewerRightPane"#
*table summary="" class="DefaultTable" cellspacing="0" cellpadding="0" width="100%" height="100%"#
*tr#
*td colspan="2" class="SViewerToolViewWrapper"#
*div align="center" style="padding:10px"#
*table width="80%" align="center" border="0" cellspacing="10" cellpadding="0" bgcolor="#f0f0f0"#
*tr#
*td#
*b#*label class="title"#*%= I18nUtil.getString("bulk_update_processes_complete", locale)%#*/label#*/b#
*p#
*label class="note"#
*%= n1 == 1 ? I18nUtil.getString("one_process_updated",
Integer.toString(n1), l.getDomainId(), locale) :
I18nUtil.getString("many_process_updated",
Integer.toString(n1), l.getDomainId(), locale) %#
*%
if( n0 # 0 && n0 != n1 )
{
String mesg = "";
if(n0 == 1 && ((n1 - n0) == 1) )
mesg = I18nUtil.getString("one_process_one_error",
Integer.toString(n0), Integer.toString((n1 - n0)), locale);
if(n0 != 1 && ((n1 - n0) == 1) )
mesg = I18nUtil.getString("many_process_one_error",
Integer.toString(n0), Integer.toString((n1 - n0)), locale);
if(n0 == 1 && ((n1 - n0) != 1) )
mesg = I18nUtil.getString("one_process_many_error",
Integer.toString(n0), Integer.toString((n1 - n0)), locale);
if(n0 != 1 && ((n1 - n0) != 1) )
mesg = I18nUtil.getString("many_process_many_error",
Integer.toString(n0), Integer.toString((n1 - n0)), locale);
%#
*%= mesg%#
*%
}
%#
*/label#
*p#
*div style="text-align:right"#
*input type="submit" name="home" value='*%= I18nUtil.getString("back_to_processes", locale)%#' /#
*/div#
*/td#
*/tr#
*/table#
*/div#
*/td#
*/tr#
*/table#
*/td#
*/tr#
*tr#
*td class="FooterPane" colspan="2"#
*jsp:include page="ngFooter.jsp" /#
*/td#
*/tr#
*/table#
*/form#
*/body#
*/html#
4)
Navigate to the BpelConsole after you above steps, now use the new feature. Select the BpelProcesses you want to undeploy or use the ‘Check_all’ option and press the ‘Bulk update’ button.
Click at the bottom of the page the new ‘Process Undeploy’ option which you can use to undeploy all the selected processes.
5) Check all the selected processes will get undeployed
Comments