use of org.wso2.transport.http.netty.config.Parameter in project carbon-business-process by wso2.
the class HumanTaskStore method createAxisService.
// Creates the AxisService object from the provided ServiceBuilder object.
private AxisService createAxisService(WSDL11ToAxisServiceBuilder serviceBuilder, HumanTaskBaseConfiguration config) throws AxisFault {
AxisService axisService;
axisService = serviceBuilder.populateService();
axisService.setParent(getTenantAxisConfig());
axisService.setWsdlFound(true);
axisService.setCustomWsdl(true);
// axisService.setFileName(new URL(taskConfig.getWsdlDefLocation()));
axisService.setClassLoader(getTenantAxisConfig().getServiceClassLoader());
Utils.setEndpointsToAllUsedBindings(axisService);
axisService.addParameter(new Parameter("modifyUserWSDLPortAddress", "true"));
/* Setting service type to use in service management*/
axisService.addParameter(ServerConstants.SERVICE_TYPE, "humantask");
/* Fix for losing of security configuration when updating human-task package*/
axisService.addParameter(new Parameter(CarbonConstants.PRESERVE_SERVICE_HISTORY_PARAM, "true"));
Iterator operations = axisService.getOperations();
AxisHumanTaskMessageReceiver msgReceiver = new AxisHumanTaskMessageReceiver();
msgReceiver.setHumanTaskEngine(HumanTaskServiceComponent.getHumanTaskServer().getTaskEngine());
// Setting the task configuration to the message receiver. Hence no need to search for task configuration, when
// the actual task invocation happens, we will already have the task configuration attached to the message receiver
// itself
msgReceiver.setTaskBaseConfiguration(config);
while (operations.hasNext()) {
AxisOperation operation = (AxisOperation) operations.next();
// Setting Message Receiver even if operation has a message receiver specified.
// This is to fix the issue when build service configuration using services.xml(Always RPCMessageReceiver
// is set to operations).
operation.setMessageReceiver(msgReceiver);
getTenantAxisConfig().getPhasesInfo().setOperationPhases(operation);
}
Set<String> exposedTransports = getTenantAxisConfig().getTransportsIn().keySet();
// Add the transports to axis2 service by reading from the tenant transport config
for (String transport : exposedTransports) {
axisService.addExposedTransport(transport);
}
if (HumanTaskServiceComponent.getHumanTaskServer().getServerConfig().isHtCoordinationEnabled() && HumanTaskServiceComponent.getHumanTaskServer().getServerConfig().isTaskRegistrationEnabled() && config.getConfigurationType() == HumanTaskBaseConfiguration.ConfigurationType.TASK) {
// Only Engage coordination module in-case of Tasks. Coordination module is not required for notifications
axisService.engageModule(getConfigContext().getAxisConfiguration().getModule("htcoordination"));
}
return axisService;
}
use of org.wso2.transport.http.netty.config.Parameter in project carbon-business-process by wso2.
the class ActivitiDAO method querySubstituteInfo.
/**
* Return the list of substitute info based on query parameters.
* @param model model with only required query parameter values. Leave others as null. By default enabled=false.
* @return List<SubstitutesDataModel> Result set of substitute info
*/
public List<SubstitutesDataModel> querySubstituteInfo(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.querySubstitutes(rw, model);
}
};
return managementService.executeCustomSql(customSqlExecution);
}
use of org.wso2.transport.http.netty.config.Parameter in project carbon-business-process by wso2.
the class FormDataService method getFormData.
@GET
@Path("/")
@Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
public Response getFormData() {
String taskId = uriInfo.getQueryParameters().getFirst("taskId");
String processDefinitionId = uriInfo.getQueryParameters().getFirst("processDefinitionId");
if (taskId == null && processDefinitionId == null) {
throw new ActivitiIllegalArgumentException("The taskId or processDefinitionId parameter has to be provided");
}
if (taskId != null && processDefinitionId != null) {
throw new ActivitiIllegalArgumentException("Not both a taskId and a processDefinitionId parameter can be provided");
}
FormData formData = null;
String id = null;
FormService formService = BPMNOSGIService.getFormService();
if (taskId != null) {
formData = formService.getTaskFormData(taskId);
id = taskId;
} else {
formData = formService.getStartFormData(processDefinitionId);
id = processDefinitionId;
}
if (formData == null) {
throw new ActivitiObjectNotFoundException("Could not find a form data with id '" + id + "'.", FormData.class);
}
return Response.ok().entity(new RestResponseFactory().createFormDataResponse(formData, uriInfo.getBaseUri().toString())).build();
}
use of org.wso2.transport.http.netty.config.Parameter in project ballerina by ballerina-lang.
the class ParserUtils method createNewFunction.
/**
* Create new function.
*
* @param name name of the function
* @param annotations list of annotations
* @param params list of parameters
* @param returnParams list of return params
* @return {Function} function
*/
private static Function createNewFunction(String name, List<AnnotationAttachment> annotations, List<Parameter> params, List<Parameter> returnParams, String receiverType, boolean isPublic, String fileName) {
Function function = new Function();
function.setName(name);
function.setAnnotations(annotations);
function.setParameters(params);
function.setReturnParams(returnParams);
function.setReceiverType(receiverType);
function.setPublic(isPublic);
function.setFileName(fileName);
return function;
}
use of org.wso2.transport.http.netty.config.Parameter in project ballerina by ballerina-lang.
the class ParserUtils method createNewParameter.
/**
* Create new parameter.
*
* @param name parameter name
* @param type parameter type
* @return {Parameter} parameter
*/
private static Parameter createNewParameter(String name, String type, BLangType typeNode) {
Parameter parameter = new Parameter();
parameter.setType(type);
parameter.setName(name);
BType bType = typeNode.type;
if (bType instanceof BConnectorType) {
parameter.setPkgAlias(((BLangUserDefinedType) typeNode).pkgAlias.toString());
parameter.setConnector(true);
}
return parameter;
}
Aggregations