use of org.wso2.carbon.event.output.adapter.core.Property in project carbon-business-process by wso2.
the class HistoricVariableInstanceQueryService method queryVariableInstances.
@POST
@Path("/")
@Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
public Response queryVariableInstances(HistoricVariableInstanceQueryRequest queryRequest) {
Map<String, String> allRequestParams = new HashMap<>();
for (String property : allPropertiesList) {
String value = uriInfo.getQueryParameters().getFirst(property);
if (value != null) {
allRequestParams.put(property, value);
}
}
DataResponse dataResponse = getQueryResponse(queryRequest, allRequestParams);
return Response.ok().entity(dataResponse).build();
}
use of org.wso2.carbon.event.output.adapter.core.Property in project carbon-business-process by wso2.
the class DeploymentService method getDeployments.
@GET
@Path("/")
@Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
public Response getDeployments() {
RepositoryService repositoryService = BPMNOSGIService.getRepositoryService();
DeploymentQuery deploymentQuery = repositoryService.createDeploymentQuery();
// Apply filters
Map<String, String> allRequestParams = new HashMap<>();
for (String property : allPropertiesList) {
String value = uriInfo.getQueryParameters().getFirst(property);
if (value != null) {
allRequestParams.put(property, value);
}
}
String name = uriInfo.getQueryParameters().getFirst("name");
if (name != null) {
deploymentQuery.deploymentName(name);
}
String nameLike = uriInfo.getQueryParameters().getFirst("nameLike");
if (nameLike != null) {
deploymentQuery.deploymentNameLike(nameLike);
}
String category = uriInfo.getQueryParameters().getFirst("category");
if (category != null) {
deploymentQuery.deploymentCategory(category);
}
String categoryNotEquals = uriInfo.getQueryParameters().getFirst("categoryNotEquals");
if (categoryNotEquals != null) {
deploymentQuery.deploymentCategoryNotEquals(categoryNotEquals);
}
String tenantId = uriInfo.getQueryParameters().getFirst("tenantId");
if (tenantId != null) {
deploymentQuery.deploymentTenantId(tenantId);
}
String tenantIdLike = uriInfo.getQueryParameters().getFirst("tenantIdLike");
if (tenantIdLike != null) {
deploymentQuery.deploymentTenantIdLike(tenantIdLike);
}
String sWithoutTenantId = uriInfo.getQueryParameters().getFirst("withoutTenantId");
if (sWithoutTenantId != null) {
Boolean withoutTenantId = Boolean.valueOf(sWithoutTenantId);
if (withoutTenantId) {
deploymentQuery.deploymentWithoutTenantId();
}
}
DeploymentsPaginateList deploymentsPaginateList = new DeploymentsPaginateList(new RestResponseFactory(), uriInfo);
DataResponse dataResponse = deploymentsPaginateList.paginateList(allRequestParams, deploymentQuery, "id", allowedSortProperties);
return Response.ok().entity(dataResponse).build();
}
use of org.wso2.carbon.event.output.adapter.core.Property in project carbon-business-process by wso2.
the class HistoricDetailQueryService method queryHistoricDetail.
@POST
@Path("/")
@Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
public Response queryHistoricDetail(HistoricDetailQueryRequest queryRequest) {
Map<String, String> allRequestParams = new HashMap<>();
for (String property : allPropertiesList) {
String value = uriInfo.getQueryParameters().getFirst(property);
if (value != null) {
allRequestParams.put(property, value);
}
}
DataResponse dataResponse = getQueryResponse(queryRequest, allRequestParams, uriInfo);
return Response.ok().entity(dataResponse).build();
}
use of org.wso2.carbon.event.output.adapter.core.Property in project carbon-business-process by wso2.
the class ModelService method getModels.
@GET
@Path("/")
@Produces(MediaType.APPLICATION_JSON)
public Response getModels() {
RepositoryService repositoryService = BPMNOSGIService.getRepositoryService();
// Apply filters
Map<String, String> allRequestParams = new HashMap<>();
for (String property : allPropertiesList) {
String value = uriInfo.getQueryParameters().getFirst(property);
if (value != null) {
allRequestParams.put(property, value);
}
}
ModelQuery modelQuery = repositoryService.createModelQuery();
String id = uriInfo.getQueryParameters().getFirst("id");
if (id != null) {
modelQuery.modelId(id);
}
String category = uriInfo.getQueryParameters().getFirst("category");
if (category != null) {
modelQuery.modelCategory(category);
}
String categoryLike = uriInfo.getQueryParameters().getFirst("categoryLike");
if (categoryLike != null) {
modelQuery.modelCategoryLike(categoryLike);
}
String categoryNotEquals = uriInfo.getQueryParameters().getFirst("categoryNotEquals");
if (categoryNotEquals != null) {
modelQuery.modelCategoryNotEquals(categoryNotEquals);
}
String name = uriInfo.getQueryParameters().getFirst("name");
if (name != null) {
modelQuery.modelName(name);
}
String nameLike = uriInfo.getQueryParameters().getFirst("nameLike");
if (nameLike != null) {
modelQuery.modelNameLike(nameLike);
}
String key = uriInfo.getQueryParameters().getFirst("key");
if (key != null) {
modelQuery.modelKey(key);
}
String version = uriInfo.getQueryParameters().getFirst("version");
if (version != null) {
modelQuery.modelVersion(Integer.valueOf(version));
}
String latestVersion = uriInfo.getQueryParameters().getFirst("latestVersion");
if (latestVersion != null) {
boolean isLatestVersion = Boolean.valueOf(latestVersion);
if (isLatestVersion) {
modelQuery.latestVersion();
}
}
String deploymentId = uriInfo.getQueryParameters().getFirst("deploymentId");
if (deploymentId != null) {
modelQuery.deploymentId(deploymentId);
}
String deployed = uriInfo.getQueryParameters().getFirst("deployed");
if (deployed != null) {
boolean isDeployed = Boolean.valueOf(deployed);
if (isDeployed) {
modelQuery.deployed();
} else {
modelQuery.notDeployed();
}
}
String tenantId = uriInfo.getQueryParameters().getFirst("tenantId");
if (tenantId != null) {
modelQuery.modelTenantId(tenantId);
}
String tenantIdLike = uriInfo.getQueryParameters().getFirst("tenantIdLike");
if (tenantIdLike != null) {
modelQuery.modelTenantIdLike(tenantIdLike);
}
String sWithoutTenantId = uriInfo.getQueryParameters().getFirst("withoutTenantId");
if (sWithoutTenantId != null) {
boolean withoutTenantId = Boolean.valueOf(sWithoutTenantId);
if (withoutTenantId) {
modelQuery.modelWithoutTenantId();
}
}
DataResponse response = new ModelsPaginateList(new RestResponseFactory(), uriInfo).paginateList(allRequestParams, modelQuery, "id", allowedSortProperties);
List<ModelResponse> modelResponseList = (List<ModelResponse>) response.getData();
if (log.isDebugEnabled()) {
log.debug("modelResponseList: " + modelResponseList.size());
}
return Response.ok().entity(response).build();
}
use of org.wso2.carbon.event.output.adapter.core.Property in project carbon-business-process by wso2.
the class BPMNDeployer method init.
/**
* Initializes the deployment per tenant
*
* @param configurationContext axis2 configurationContext
*/
@Override
public void init(ConfigurationContext configurationContext) {
Integer tenantId = CarbonContext.getThreadLocalCarbonContext().getTenantId();
log.info("Initializing BPMN Deployer for tenant " + tenantId + ".");
try {
File tenantRepoFolder = createTenantRepo(configurationContext);
tenantRepository = BPMNServerHolder.getInstance().getTenantManager().createTenantRepository(tenantId);
tenantRepository.setRepoFolder(tenantRepoFolder);
// This is to check whether the user have added resolveDeploymentAtStartup system property to true if need
// for resolving deployment to avoid inconsistencies
boolean fixDeployments = true;
if (System.getProperty(BPMNConstants.RESOLVE_DEPLOYMENT_SYS_PROP) != null && !Boolean.parseBoolean(System.getProperty(BPMNConstants.RESOLVE_DEPLOYMENT_SYS_PROP))) {
fixDeployments = false;
log.info("BPMN deployment inconsistencies will not resolved");
}
if (!isWorkerNode() && fixDeployments) {
log.info("Resolving BPMN deployments to avoid inconsistencies");
tenantRepository.fixDeployments();
}
} catch (BPSFault e) {
String msg = "Tenant Error: " + tenantId;
log.error(msg, e);
}
}
Aggregations