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
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to