use of org.wso2.ballerinalang.compiler.codegen.CodeGenerator.VariableIndex.Kind.PACKAGE in project carbon-business-process by wso2.
the class BPELPackageManagementServiceSkeleton method getLatestVersionInPackage.
/**
* This method will return the latest version of the BPEL package
* @param packageName BPEL package name
* @return Latest package version
* @throws PackageManagementException
*/
public String getLatestVersionInPackage(String packageName) throws PackageManagementException {
TenantProcessStoreImpl tenantProcessStore = getTenantProcessStore();
BPELPackageRepository packageRepo = tenantProcessStore.getBPELPackageRepository();
try {
return packageRepo.getBPELPackageInfoForPackage(packageName).getLatestVersion();
} catch (Exception e) {
String errMsg = "BPEL package: " + packageName + " failed to get latest version.";
log.error(errMsg, e);
throw new PackageManagementException(errMsg, e);
}
}
use of org.wso2.ballerinalang.compiler.codegen.CodeGenerator.VariableIndex.Kind.PACKAGE in project carbon-business-process by wso2.
the class BPELBindingContextImpl method publishAxisService.
private BPELProcessProxy publishAxisService(ProcessConf processConfiguration, QName serviceName, String portName) throws AxisFault {
// TODO: Need to fix this to suite multi-tenant environment
// TODO: There is a problem in this, in this manner we can't have two axis services with
// same QName
BPELProcessProxy processProxy = new BPELProcessProxy(processConfiguration, bpelServer, serviceName, portName);
ConfigurationContext tenantConfigCtx = getConfigurationContextFromProcessConfiguration(processConfiguration);
AxisService axisService;
try {
axisService = AxisServiceUtils.createAxisService(tenantConfigCtx.getAxisConfiguration(), processProxy);
EndpointConfiguration endpointConfig = ((ProcessConfigurationImpl) processConfiguration).getEndpointConfiguration(new WSDL11Endpoint(serviceName, portName));
ServiceConfigurationUtil.configureService(axisService, endpointConfig, tenantConfigCtx);
} catch (AxisFault e) {
log.error("Error occurred creating the axis service " + serviceName.toString());
throw new DeploymentException("BPEL Package deployment failed.", e);
}
processProxy.setAxisService(axisService);
removeBPELProcessProxyAndAxisService(processConfiguration.getDeployer(), serviceName, portName);
services.put(processConfiguration.getDeployer(), serviceName, portName, processProxy);
ArrayList<AxisService> serviceList = new ArrayList<AxisService>();
serviceList.add(axisService);
DeploymentEngine.addServiceGroup(createServiceGroupForService(axisService), serviceList, null, null, tenantConfigCtx.getAxisConfiguration());
//
if (log.isDebugEnabled()) {
log.debug("BPELProcessProxy created for process " + processConfiguration.getProcessId());
log.debug("AxisService " + serviceName + " created for BPEL process " + processConfiguration.getProcessId());
}
return processProxy;
}
use of org.wso2.ballerinalang.compiler.codegen.CodeGenerator.VariableIndex.Kind.PACKAGE in project carbon-business-process by wso2.
the class BPMNDeploymentService method getDeploymentsByName.
/**
* Get the deployments for given package name , order by deploymentID
*
* @param deploymentName
* @return
*/
public BPMNDeployment[] getDeploymentsByName(String deploymentName) {
List<BPMNDeployment> bpmnDeploymentList = new ArrayList<>();
Integer tenantId = CarbonContext.getThreadLocalCarbonContext().getTenantId();
DeploymentQuery query = BPMNServerHolder.getInstance().getEngine().getRepositoryService().createDeploymentQuery();
// Set deployment name and order by ID
query = query.deploymentTenantId(tenantId.toString()).deploymentName(deploymentName).orderByDeploymentId().desc();
List<Deployment> deployments = query.list();
for (Deployment deployment : deployments) {
BPMNDeployment bpmnDeployment = new BPMNDeployment();
bpmnDeployment.setDeploymentId(deployment.getId());
bpmnDeployment.setDeploymentName(deployment.getName());
bpmnDeployment.setDeploymentTime(deployment.getDeploymentTime());
bpmnDeploymentList.add(bpmnDeployment);
}
return bpmnDeploymentList.toArray(new BPMNDeployment[bpmnDeploymentList.size()]);
}
use of org.wso2.ballerinalang.compiler.codegen.CodeGenerator.VariableIndex.Kind.PACKAGE in project carbon-business-process by wso2.
the class BPMNDeployer method undeploy.
/**
* Undeployment operation for Bpmn Deployer
*
* @param bpmnArchivePath archivePatch
* @throws DeploymentException Deployment failure will result in this exception
*/
public void undeploy(String bpmnArchivePath) throws DeploymentException {
if (isWorkerNode()) {
return;
}
if (System.getProperty(BPMNConstants.RESOLVE_DEPLOYMENT_SYS_PROP) != null && Boolean.parseBoolean(System.getProperty(BPMNConstants.RESOLVE_DEPLOYMENT_SYS_PROP)) || System.getProperty(BPMNConstants.RESOLVE_DEPLOYMENT_SYS_PROP) == null) {
File bpmnArchiveFile = new File(bpmnArchivePath);
if (bpmnArchiveFile.exists()) {
if (log.isTraceEnabled()) {
log.trace("BPMN package: " + bpmnArchivePath + " exists in the deployment folder. " + "Therefore, this can be an update of the package and the undeployment will be aborted.");
}
return;
}
Integer tenantId = CarbonContext.getThreadLocalCarbonContext().getTenantId();
log.info("Undeploying BPMN archive " + bpmnArchivePath + " for tenant: " + tenantId);
String deploymentName = FilenameUtils.getBaseName(bpmnArchivePath);
try {
tenantRepository.undeploy(deploymentName, true);
} catch (BPSFault be) {
String errorMsg = "Error un deploying BPMN Package " + deploymentName;
throw new DeploymentException(errorMsg, be);
}
}
}
use of org.wso2.ballerinalang.compiler.codegen.CodeGenerator.VariableIndex.Kind.PACKAGE in project carbon-business-process by wso2.
the class ActivitiDAO method selectTenantAwareDeploymentModel.
/**
* invokes the DeploymentMapper.selectMetaData for a given tenant id and package name
*
* @param tenantID tenant id
* @param bpmnPackageName package name
* @return DeploymentMetaDataModel object
*/
public DeploymentMetaDataModel selectTenantAwareDeploymentModel(final String tenantID, final String bpmnPackageName) {
CustomSqlExecution<DeploymentMapper, DeploymentMetaDataModel> customSqlExecution = new AbstractCustomSqlExecution<DeploymentMapper, DeploymentMetaDataModel>(DeploymentMapper.class) {
public DeploymentMetaDataModel execute(DeploymentMapper deploymentMapper) {
return deploymentMapper.selectMetaData(tenantID, bpmnPackageName);
}
};
DeploymentMetaDataModel deploymentMetaDataModel = managementService.executeCustomSql(customSqlExecution);
if (log.isDebugEnabled()) {
if (deploymentMetaDataModel != null) {
log.debug("DeploymentDataModel exists when selecting models=" + deploymentMetaDataModel.getId());
} else {
log.debug("DeploymentDataModel null when selecting models");
}
}
return deploymentMetaDataModel;
}
Aggregations