Hi Malith,

There is an inbuilt tool packaged with BPS for process instance cleanup.
The same tool can be used to clean packages as well.
While the server is running you can run the cleanup script
<BPS_HOME>\bin\processcleanuptool.sh side by side.
You will have to do the configurations specific to tenant which is similar
to example[2].
Once you run the tool, it will list down all the packages according to
given filter configurations. Then you can select what packages to delete.

[1]
https://github.com/wso2/product-bps/tree/master/modules/samples/product/process-tools
[2]
https://github.com/wso2/product-bps/blob/master/modules/samples/product/process-tools/src/main/resources/process-cleanup.properties

Best regards,
Amal.


On Wed, Aug 3, 2016 at 3:40 PM, Nandika Jayawardana <[email protected]>
wrote:

> Hi Malith,
>
> Can you have a look into the process instance cleanup tool. It has the
> capability to delete bpel packages as well.
>
> Regards
> Nandika
>
> On Wed, Aug 3, 2016 at 3:28 PM, Malith Munasinghe <[email protected]>
> wrote:
>
>> Hi All,
>>
>> While writing a Package undeployer tool for BPES 3.2.0 for several
>> tenants I did the following to undeploy a BPEL package. While starting the
>> tenant flow with super tenant I was able to successfully undeploy the
>> releveant package. Starting the tenant flow with a tenant I get the below
>> warning with the undeployed result as SUCCESS.
>>
>> WARN
>> {org.wso2.carbon.bpel.core.ode.integration.store.TenantProcessStoreImpl} -
>>  Cannot find BPEL package with name
>> ApplicationRegistrationWorkflowProcess_1.0.0 in the repository. If the bpel
>> package is un-deployed through the management console or if this node is a
>> member of a cluster, please ignore this warning.
>>
>> When I check the artifact though carbon console I still find the Package
>> and the undeployment is not successful.
>>
>> While debugging I found even though the tenant flow is started the
>> tenantProcessStore returns a null because the tenant specific process store
>> is not set. So is there a specific method that I should call to load this
>> process store before undeploying the package for the specific user.
>>
>> Attached below is the code snippet used to undeploy the package.
>>
>> try {
>>     PrivilegedCarbonContext.startTenantFlow();
>>     PrivilegedCarbonContext privilegedCarbonContext =
>> PrivilegedCarbonContext.getThreadLocalCarbonContext();
>>     privilegedCarbonContext.setTenantId(1);
>>     privilegedCarbonContext.setTenantDomain("abc.com");
>>     packageManagementServiceSkeleton = new
>> BPELPackageManagementServiceSkeleton();
>>
>> packageManagementServiceSkeleton.undeployBPELPackage("ApplicationRegistrationWorkflowProcess_1.0.0");
>> } finally {
>>     PrivilegedCarbonContext.endTenantFlow();
>> }
>>
>>
>> Regards,
>> Malith
>>
>>
>> --
>> Malith Munasinghe | Software Engineer
>> M: +94 (71) 9401122
>> E: [email protected]
>> W: http://wso2.com
>> <http://wso2.com/signature>
>>
>
>
>
> --
> Nandika Jayawardana
> WSO2 Inc ; http://wso2.com
> lean.enterprise.middleware
>



-- 
*Amal Gunatilake*
WSO2 Inc.; http://wso2.com
Lean . Enterprise . Middleware

mobile: (+94) 773561195
blog: amalg-blogs.blogspot.com; twitter: @daag123
linkedIn: https://www.linkedin.com/in/amalgunatilake
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to