Search in sources :

Example 1 with WSDLAwareMessage

use of org.wso2.carbon.bpel.core.ode.integration.axis2.WSDLAwareMessage in project carbon-business-process by wso2.

the class AxisServiceUtils method createAxisService.

/**
 * Build the underlying Axis Service from Service QName and Port Name of interest using given WSDL
 * for BPEL document.
 * In the current implementation we are extracting service name from the soap:address' location property.
 * But specified port may not contain soap:adress instead it may contains http:address. We need to handle that
 * situation.
 *
 * @param axisConfiguration AxisConfiguration to which we should publish the service
 * @param processProxy      BPELProcessProxy
 * @return Axis Service build using WSDL, Service and Port
 * @throws org.apache.axis2.AxisFault on error
 */
public static AxisService createAxisService(AxisConfiguration axisConfiguration, BPELProcessProxy processProxy) throws AxisFault {
    QName serviceName = processProxy.getServiceName();
    String portName = processProxy.getPort();
    Definition wsdlDefinition = processProxy.getWsdlDefinition();
    ProcessConf processConfiguration = processProxy.getProcessConfiguration();
    if (log.isDebugEnabled()) {
        log.debug("Creating AxisService: Service=" + serviceName + " port=" + portName + " WSDL=" + wsdlDefinition.getDocumentBaseURI() + " BPEL=" + processConfiguration.getBpelDocument());
    }
    WSDL11ToAxisServiceBuilder serviceBuilder = createAxisServiceBuilder(processProxy);
    /**
     * Need to figure out a way to handle service name extractoin. According to my perspective extracting
     * the service name from the EPR is not a good decision. But we need to handle JMS case properly.
     * I am keeping JMS handling untouched until we figureout best solution.
     */
    /* String axisServiceName = extractServiceName(processConf, wsdlServiceName, portName);*/
    AxisService axisService = populateAxisService(processProxy, axisConfiguration, serviceBuilder);
    Iterator operations = axisService.getOperations();
    BPELMessageReceiver messageRec = new BPELMessageReceiver();
    /**
     * Set the corresponding BPELService to message receivers
     */
    messageRec.setProcessProxy(processProxy);
    while (operations.hasNext()) {
        AxisOperation operation = (AxisOperation) operations.next();
        // Setting WSDLAwareMessage 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(messageRec);
        axisConfiguration.getPhasesInfo().setOperationPhases(operation);
    }
    /**
     * TODO: JMS Destination handling.
     */
    return axisService;
}
Also used : AxisOperation(org.apache.axis2.description.AxisOperation) QName(javax.xml.namespace.QName) ProcessConf(org.apache.ode.bpel.iapi.ProcessConf) AxisService(org.apache.axis2.description.AxisService) Definition(javax.wsdl.Definition) Iterator(java.util.Iterator) WSDL11ToAxisServiceBuilder(org.apache.axis2.description.WSDL11ToAxisServiceBuilder) BPELMessageReceiver(org.wso2.carbon.bpel.core.ode.integration.axis2.receivers.BPELMessageReceiver)

Example 2 with WSDLAwareMessage

use of org.wso2.carbon.bpel.core.ode.integration.axis2.WSDLAwareMessage in project carbon-business-process by wso2.

the class HumanTaskEngine method createTask.

// create task logic.
private TaskDAO createTask(WSDLAwareMessage message, HumanTaskBaseConfiguration taskConfiguration, int tenantId) throws HumanTaskException {
    TaskCreationContext creationContext = new TaskCreationContext();
    creationContext.setTaskConfiguration(taskConfiguration);
    creationContext.setTenantId(tenantId);
    creationContext.setMessageBodyParts(message.getBodyPartElements());
    creationContext.setMessageHeaderParts(message.getHeaderPartElements());
    creationContext.setPeopleQueryEvaluator(peopleQueryEvaluator);
    TaskDAO task = getDaoConnectionFactory().getConnection().createTask(creationContext);
    creationContext.injectExpressionEvaluationContext(task);
    return task;
}
Also used : TaskDAO(org.wso2.carbon.humantask.core.dao.TaskDAO) TaskCreationContext(org.wso2.carbon.humantask.core.dao.TaskCreationContext)

Aggregations

Iterator (java.util.Iterator)1 Definition (javax.wsdl.Definition)1 QName (javax.xml.namespace.QName)1 AxisOperation (org.apache.axis2.description.AxisOperation)1 AxisService (org.apache.axis2.description.AxisService)1 WSDL11ToAxisServiceBuilder (org.apache.axis2.description.WSDL11ToAxisServiceBuilder)1 ProcessConf (org.apache.ode.bpel.iapi.ProcessConf)1 BPELMessageReceiver (org.wso2.carbon.bpel.core.ode.integration.axis2.receivers.BPELMessageReceiver)1 TaskCreationContext (org.wso2.carbon.humantask.core.dao.TaskCreationContext)1 TaskDAO (org.wso2.carbon.humantask.core.dao.TaskDAO)1