use of org.wso2.siddhi.annotation.Parameter in project carbon-business-process by wso2.
the class BPELBindingContextImpl method deactivateMyRoleEndpoint.
public void deactivateMyRoleEndpoint(QName processID, Endpoint endpoint) {
if (log.isDebugEnabled()) {
log.debug("Deactivating my role endpoint for process: " + processID + " service: " + endpoint.serviceName + " and port: " + endpoint.portName);
}
Integer tenantId = bpelServer.getMultiTenantProcessStore().getTenantId(processID);
BPELProcessProxy processProxy = getBPELProcessProxy(tenantId.toString(), endpoint.serviceName, endpoint.portName);
if (processProxy != null) {
ProcessConfigurationImpl processConf = (ProcessConfigurationImpl) processProxy.getProcessConfiguration();
if (processConf.isUndeploying()) {
AxisService service = processProxy.getAxisService();
Parameter param = service.getParameter(CarbonConstants.PRESERVE_SERVICE_HISTORY_PARAM);
param.setValue("false");
}
removeBPELProcessProxyAndAxisService(tenantId.toString(), endpoint.serviceName, endpoint.portName);
updateServiceList(((ProcessConfigurationImpl) processProxy.getProcessConfiguration()).getTenantId(), endpoint, STATE.REMOVE);
serviceEprMap.remove(processProxy);
}
// else this method also get called for the retired processes where there could be an
// active version of the same process type. Since there is only one service for a
// particular process type, processProxy will be null for all the endpoints except for 1.
}
use of org.wso2.siddhi.annotation.Parameter in project carbon-business-process by wso2.
the class AttachmentMgtDAOConnectionFactoryImpl method init.
@Override
public void init() {
if (transactionManager == null) {
log.debug("Transaction-Manager is not initialized before initializing entityManager. So internal " + "transaction-manager in entity manager will be used.");
}
JPAVendorAdapter vendorAdapter = getJPAVendorAdapter();
// Here we pass a "null" valued transaction manager,
// as we enforce the entity-manager-factory to use its local transactions. In future,
// if required to use external JTA transactions, a transaction reference should be passed
// as the input parameter.
this.entityManagerFactory = Persistence.createEntityManagerFactory("Attachment-Mgt-PU", vendorAdapter.getJpaPropertyMap(null));
}
use of org.wso2.siddhi.annotation.Parameter in project carbon-business-process by wso2.
the class UserSubstitutionService method getSubstitute.
/**
* Return the substitute info for the given user in path parameter
* @param user
* @return SubstituteInfoResponse
* @throws URISyntaxException
*/
@GET
@Path("/{user}")
@Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
public Response getSubstitute(@PathParam("user") String user) throws UserStoreException {
if (!subsFeatureEnabled) {
return Response.status(405).build();
}
user = getTenantAwareUser(user);
int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId();
String loggedInUser = PrivilegedCarbonContext.getThreadLocalCarbonContext().getUsername();
if (!loggedInUser.equals(user) && !isUserAuthorizedForSubstitute(loggedInUser)) {
throw new BPMNForbiddenException("Not allowed to view others substitution details. No sufficient permission");
}
SubstitutesDataModel model = UserSubstitutionUtils.getSubstituteOfUser(user, tenantId);
if (model != null) {
SubstituteInfoResponse response = new SubstituteInfoResponse();
response.setSubstitute(model.getSubstitute());
response.setAssignee(model.getUser());
response.setEnabled(model.isEnabled());
response.setStartTime(model.getSubstitutionStart());
response.setEndTime(model.getSubstitutionEnd());
return Response.ok(response).build();
} else {
return Response.status(404).build();
}
}
use of org.wso2.siddhi.annotation.Parameter in project carbon-business-process by wso2.
the class UserSubstitutionUtils method getPaginatedModelFromRequest.
/**
* Prepare the paginated data model for a substitution query
* @param propertiesMap
* @param tenantId
* @return PaginatedSubstitutesDataModel
*/
private static PaginatedSubstitutesDataModel getPaginatedModelFromRequest(Map<String, String> propertiesMap, int tenantId) {
PaginatedSubstitutesDataModel model = new PaginatedSubstitutesDataModel();
if (propertiesMap.get(SubstitutionQueryProperties.SUBSTITUTE) != null) {
model.setSubstitute(propertiesMap.get(SubstitutionQueryProperties.SUBSTITUTE));
}
if (propertiesMap.get(SubstitutionQueryProperties.USER) != null) {
model.setUser(propertiesMap.get(SubstitutionQueryProperties.USER));
}
String enabled = propertiesMap.get(SubstitutionQueryProperties.ENABLED);
if (enabled != null) {
if (enabled.equalsIgnoreCase("true")) {
model.setEnabled(true);
} else if (enabled.equalsIgnoreCase("false")) {
model.setEnabled(false);
} else {
throw new ActivitiIllegalArgumentException("Invalid parameter " + enabled + " for enabled property.");
}
}
model.setTenantId(tenantId);
int start = Integer.parseInt(propertiesMap.get(SubstitutionQueryProperties.START));
int size = Integer.parseInt(propertiesMap.get(SubstitutionQueryProperties.SIZE));
model.setStart(start);
model.setSize(size);
model.setOrder(propertiesMap.get(SubstitutionQueryProperties.ORDER));
model.setSort(propertiesMap.get(SubstitutionQueryProperties.SORT));
return model;
}
use of org.wso2.siddhi.annotation.Parameter in project carbon-business-process by wso2.
the class ActivitiDAO method querySubstituteInfoWithoutEnabled.
/**
* Return the list of substitute info based on query parameters except enabled property.
* @param model data model with only required query parameter values. Leave others as null.
* @return List<PaginatedSubstitutesDataModel> Result set of substitute info
*/
public List<SubstitutesDataModel> querySubstituteInfoWithoutEnabled(final PaginatedSubstitutesDataModel model) {
final RowBounds rw = new RowBounds(model.getStart(), model.getSize());
CustomSqlExecution<SubstitutesMapper, List<SubstitutesDataModel>> customSqlExecution = new AbstractCustomSqlExecution<SubstitutesMapper, List<SubstitutesDataModel>>(SubstitutesMapper.class) {
public List<SubstitutesDataModel> execute(SubstitutesMapper substitutesMapper) {
return substitutesMapper.querySubstitutesWithoutEnabled(rw, model);
}
};
return managementService.executeCustomSql(customSqlExecution);
}
Aggregations