use of org.wso2.carbon.bpel.common.config.EndpointConfiguration in project carbon-business-process by wso2.
the class ProcessConfigurationImpl method readPackageConfiguration.
private void readPackageConfiguration() {
File depDir = du.getDeployDir();
/*
Read Endpoint Config for invokes
*/
List<TDeployment.Process> processList = du.getDeploymentDescriptor().getDeploy().getProcessList();
for (TDeployment.Process process : processList) {
List<TInvoke> tInvokeList = process.getInvokeList();
for (TInvoke tInvoke : tInvokeList) {
OMElement serviceEle;
if (tInvoke.getService() == null) {
String errMsg = "Service element missing for the invoke element in deploy.xml";
log.error(errMsg);
throw new BPELDeploymentException(errMsg);
}
try {
serviceEle = AXIOMUtil.stringToOM(tInvoke.getService().toString());
OMElement endpointEle = serviceEle.getFirstElement();
if (endpointEle == null || !endpointEle.getQName().equals(new QName(BusinessProcessConstants.BPEL_PKG_ENDPOINT_CONFIG_NS, BusinessProcessConstants.ENDPOINT))) {
continue;
}
EndpointConfiguration epConf = EndpointConfigBuilder.buildEndpointConfiguration(endpointEle, depDir.getAbsolutePath());
epConf.setServiceName(tInvoke.getService().getName().getLocalPart());
epConf.setServiceNS(tInvoke.getService().getName().getNamespaceURI());
epConf.setServicePort(tInvoke.getService().getPort());
bpelPackageConfiguration.addEndpoint(epConf);
} catch (XMLStreamException e) {
log.warn("Error occurred while reading endpoint configuration. " + "Endpoint config will not be applied to: " + tInvoke.getService());
}
}
List<TProvide> tProvideList = process.getProvideList();
for (TProvide tProvide : tProvideList) {
OMElement serviceEle;
if (tProvide.getService() == null) {
String errMsg = "Service element missing for the provide element in deploy.xml";
log.error(errMsg);
throw new BPELDeploymentException(errMsg);
}
try {
serviceEle = AXIOMUtil.stringToOM(tProvide.getService().toString());
OMElement endpointEle = serviceEle.getFirstElement();
if (endpointEle == null || !endpointEle.getQName().equals(new QName(BusinessProcessConstants.BPEL_PKG_ENDPOINT_CONFIG_NS, BusinessProcessConstants.ENDPOINT))) {
continue;
}
EndpointConfiguration epConf = EndpointConfigBuilder.buildEndpointConfiguration(endpointEle, depDir.getAbsolutePath());
epConf.setServiceName(tProvide.getService().getName().getLocalPart());
epConf.setServiceNS(tProvide.getService().getName().getNamespaceURI());
epConf.setServicePort(tProvide.getService().getPort());
bpelPackageConfiguration.addEndpoint(epConf);
} catch (XMLStreamException e) {
log.warn("Error occured while reading endpoint configuration. " + "Endpoint config will not be applied to: " + tProvide.getService());
}
}
}
}
use of org.wso2.carbon.bpel.common.config.EndpointConfiguration in project carbon-business-process by wso2.
the class HumanTaskStore method createCallBackService.
private void createCallBackService(TaskConfiguration taskConf) throws HumanTaskDeploymentException {
EndpointConfiguration endpointConfig = taskConf.getEndpointConfiguration(taskConf.getCallbackServiceName().getLocalPart(), taskConf.getCallbackPortName());
CallBackServiceImpl callbackService = new CallBackServiceImpl(tenantId, taskConf.getCallbackServiceName(), taskConf.getCallbackPortName(), taskConf.getName(), taskConf.getResponseWSDL(), taskConf.getResponseOperation(), endpointConfig);
taskConf.setCallBackService(callbackService);
}
use of org.wso2.carbon.bpel.common.config.EndpointConfiguration in project carbon-business-process by wso2.
the class NotificationConfiguration method initEndpointConfigs.
private void initEndpointConfigs() throws HumanTaskDeploymentException {
TPublish.Service service = notificationDeploymentConfiguration.getPublish().getService();
OMElement serviceEle;
serviceEle = HumanTaskStoreUtils.getOMElement(service.toString());
EndpointConfiguration endpointConfig = HumanTaskStoreUtils.getEndpointConfig(serviceEle);
if (endpointConfig != null) {
endpointConfig.setServiceName(service.getName().getLocalPart());
endpointConfig.setServicePort(service.getPort());
endpointConfig.setServiceNS(service.getName().getNamespaceURI());
endpointConfig.setBasePath(getHumanTaskDefinitionFile().getParentFile().getAbsolutePath());
endpointConfig.setServiceDescriptionLocation(service.getServiceDescriptionReference());
addEndpointConfiguration(endpointConfig);
}
}
use of org.wso2.carbon.bpel.common.config.EndpointConfiguration in project carbon-business-process by wso2.
the class HumanTaskStoreUtils method getEndpointConfig.
public static EndpointConfiguration getEndpointConfig(OMElement serviceEle) {
String serviceDescLocation = serviceEle.getAttributeValue(new QName(null, BusinessProcessConstants.SERVICE_DESC_LOCATION));
if (StringUtils.isNotEmpty(serviceDescLocation)) {
EndpointConfiguration endpointConfig = new EndpointConfiguration();
endpointConfig.setServiceDescriptionAvailable(true);
endpointConfig.setServiceDescriptionLocation(serviceDescLocation.trim());
return endpointConfig;
}
String endpointRef = serviceEle.getAttributeValue(new QName(null, BusinessProcessConstants.ENDPOINTREF));
if (StringUtils.isNotEmpty(endpointRef)) {
EndpointConfiguration endpointConfig = new EndpointConfiguration();
endpointConfig.setUnifiedEndPointReference(endpointRef.trim());
return endpointConfig;
}
return null;
}
use of org.wso2.carbon.bpel.common.config.EndpointConfiguration in project carbon-business-process by wso2.
the class PeopleActivity method getUnifiedEndpoint.
public UnifiedEndpoint getUnifiedEndpoint() throws FaultException {
int tenantId = B4PServiceComponent.getBPELServer().getMultiTenantProcessStore().getTenantId(processId);
ProcessConfigurationImpl processConf = (ProcessConfigurationImpl) B4PServiceComponent.getBPELServer().getMultiTenantProcessStore().getTenantsProcessStore(tenantId).getProcessConfiguration(processId);
EndpointConfiguration epConf = processConf.getEndpointConfiguration(new WSDL11Endpoint(serviceName, servicePort));
try {
return epConf.getUnifiedEndpoint();
} catch (AxisFault axisFault) {
throw new FaultException(BPEL4PeopleConstants.B4P_FAULT, "Error occurred while reading UnifiedEndpoint for service " + serviceName, axisFault);
}
}
Aggregations