use of org.apache.ode.bpel.runtime.BpelRuntimeContext in project carbon-business-process by wso2.
the class PeopleActivity method deriveServiceEPR.
private void deriveServiceEPR(DeploymentUnitDir du, ExtensionContext extensionContext) throws FaultException {
DeployDocument deployDocument = du.getDeploymentDescriptor();
BpelRuntimeContext runTimeContext = extensionContext.getInternalInstance();
// TODO neeed to extend ExtentionContext
OProcess oProcess = runTimeContext.getProcessModel();
TDeployment.Process hiProcess = null;
List<TDeployment.Process> processList = deployDocument.getDeploy().getProcessList();
for (TDeployment.Process process : processList) {
if (process.getName().equals(oProcess.getQName())) {
hiProcess = process;
break;
}
}
if (hiProcess == null) {
throw new FaultException(BPEL4PeopleConstants.B4P_FAULT, "Related process: " + oProcess.getQName() + " not found");
}
List<TInvoke> tInvokeList = hiProcess.getInvokeList();
for (TInvoke tInvoke : tInvokeList) {
if (tInvoke.getPartnerLink().equals(partnerLinkName)) {
serviceName = tInvoke.getService().getName();
servicePort = tInvoke.getService().getPort();
break;
}
}
if (serviceName == null || servicePort == null) {
log.error("service and port for human interaction is not found in the deploy.xml");
throw new FaultException(BPEL4PeopleConstants.B4P_FAULT, "Service or port for human interaction is not found in the deploy.xml");
}
// get the callback information for the TASK
if (activityType.equals(InteractionType.TASK)) {
List<TProvide> tProvideList = hiProcess.getProvideList();
for (TProvide tProvide : tProvideList) {
if (tProvide.getPartnerLink().equals(partnerLinkName)) {
callbackServiceName = tProvide.getService().getName();
callbackServicePort = tProvide.getService().getPort();
break;
}
}
if (callbackServiceName == null || callbackServicePort == null) {
throw new FaultException(BPEL4PeopleConstants.B4P_FAULT, "Service or port for human task callback is not found in the deploy.xml");
}
}
hiWSDL = du.getDefinitionForService(serviceName);
Service service = hiWSDL.getService(serviceName);
Port port = service.getPort(servicePort);
List extList = port.getExtensibilityElements();
for (Object extEle : extList) {
if (extEle instanceof SOAPAddressImpl) {
SOAPAddressImpl soapAddress = (SOAPAddressImpl) extEle;
serviceURI = soapAddress.getLocationURI();
break;
}
}
if (serviceURI == null) {
throw new FaultException(BPEL4PeopleConstants.B4P_FAULT, "Service URI is not available");
}
}
use of org.apache.ode.bpel.runtime.BpelRuntimeContext in project carbon-business-process by wso2.
the class PeopleActivity method getOperation.
public Operation getOperation(ExtensionContext extensionContext) {
BpelRuntimeContext runTimeContext = extensionContext.getInternalInstance();
OProcess process = runTimeContext.getProcessModel();
OPartnerLink partnerLink = process.getPartnerLink(partnerLinkName);
return partnerLink.getPartnerRoleOperation(operation);
}
Aggregations