Search in sources :

Example 11 with InsuranceService

use of com.salaboy.jbpm5.dev.guide.webservice.InsuranceService in project jBPM5-Developer-Guide by Salaboy.

the class InsuranceServiceWorkItemHandler method getClient.

private InsuranceService getClient() {
    InsuranceService client = null;
    try {
        URL wsdlURL = new URL("http://127.0.0.1:19999/InsuranceServiceImpl/insurance?WSDL");
        QName SERVICE_QNAME = new QName("http://webservice.guide.dev.jbpm5.salaboy.com/", "InsuranceServiceImplService");
        Service service = Service.create(wsdlURL, SERVICE_QNAME);
        client = service.getPort(InsuranceService.class);
    } catch (MalformedURLException ex) {
        Logger.getLogger(CompanyGatewayWorkItemHandler.class.getName()).log(Level.SEVERE, null, ex);
    }
    return client;
}
Also used : MalformedURLException(java.net.MalformedURLException) InsuranceService(com.salaboy.jbpm5.dev.guide.webservice.InsuranceService) QName(javax.xml.namespace.QName) InsuranceService(com.salaboy.jbpm5.dev.guide.webservice.InsuranceService) Service(javax.xml.ws.Service) URL(java.net.URL)

Example 12 with InsuranceService

use of com.salaboy.jbpm5.dev.guide.webservice.InsuranceService in project jBPM5-Developer-Guide by Salaboy.

the class PatientDataServiceWorkItemHandler method getClient.

private InsuranceService getClient() {
    InsuranceService client = null;
    try {
        URL wsdlURL = new URL("http://127.0.0.1:19999/InsuranceServiceImpl/insurance?WSDL");
        QName SERVICE_QNAME = new QName("http://webservice.guide.dev.jbpm5.salaboy.com/", "InsuranceServiceImplService");
        Service service = Service.create(wsdlURL, SERVICE_QNAME);
        client = service.getPort(InsuranceService.class);
    } catch (MalformedURLException ex) {
        Logger.getLogger(CompanyGatewayWorkItemHandler.class.getName()).log(Level.SEVERE, null, ex);
    }
    return client;
}
Also used : MalformedURLException(java.net.MalformedURLException) InsuranceService(com.salaboy.jbpm5.dev.guide.webservice.InsuranceService) QName(javax.xml.namespace.QName) InsuranceService(com.salaboy.jbpm5.dev.guide.webservice.InsuranceService) Service(javax.xml.ws.Service) URL(java.net.URL)

Example 13 with InsuranceService

use of com.salaboy.jbpm5.dev.guide.webservice.InsuranceService in project jBPM5-Developer-Guide by Salaboy.

the class CompanyGatewayWorkItemHandler method getClient.

private InsuranceService getClient() {
    InsuranceService client = null;
    try {
        URL wsdlURL = new URL("http://127.0.0.1:19999/InsuranceServiceImpl/insurance?WSDL");
        QName SERVICE_QNAME = new QName("http://webservice.guide.dev.jbpm5.salaboy.com/", "InsuranceServiceImplService");
        Service service = Service.create(wsdlURL, SERVICE_QNAME);
        client = service.getPort(InsuranceService.class);
    } catch (MalformedURLException ex) {
        Logger.getLogger(CompanyGatewayWorkItemHandler.class.getName()).log(Level.SEVERE, null, ex);
    }
    return client;
}
Also used : MalformedURLException(java.net.MalformedURLException) InsuranceService(com.salaboy.jbpm5.dev.guide.webservice.InsuranceService) QName(javax.xml.namespace.QName) InsuranceService(com.salaboy.jbpm5.dev.guide.webservice.InsuranceService) Service(javax.xml.ws.Service) URL(java.net.URL)

Example 14 with InsuranceService

use of com.salaboy.jbpm5.dev.guide.webservice.InsuranceService in project jBPM5-Developer-Guide by Salaboy.

the class RatesServiceWorkItemHandler method getClient.

private InsuranceService getClient() {
    InsuranceService client = null;
    try {
        URL wsdlURL = new URL("http://127.0.0.1:19999/InsuranceServiceImpl/insurance?WSDL");
        QName SERVICE_QNAME = new QName("http://webservice.guide.dev.jbpm5.salaboy.com/", "InsuranceServiceImplService");
        Service service = Service.create(wsdlURL, SERVICE_QNAME);
        client = service.getPort(InsuranceService.class);
    } catch (MalformedURLException ex) {
        Logger.getLogger(CompanyGatewayWorkItemHandler.class.getName()).log(Level.SEVERE, null, ex);
    }
    return client;
}
Also used : MalformedURLException(java.net.MalformedURLException) InsuranceService(com.salaboy.jbpm5.dev.guide.webservice.InsuranceService) QName(javax.xml.namespace.QName) InsuranceService(com.salaboy.jbpm5.dev.guide.webservice.InsuranceService) Service(javax.xml.ws.Service) URL(java.net.URL)

Example 15 with InsuranceService

use of com.salaboy.jbpm5.dev.guide.webservice.InsuranceService in project jBPM5-Developer-Guide by Salaboy.

the class RatesServiceWorkItemHandler method executeWorkItem.

public void executeWorkItem(WorkItem wi, WorkItemManager wim) {
    String patientId = (String) wi.getParameter("rates_patientName");
    BigDecimal finalAmount = BigDecimal.ZERO;
    // Mock Data
    List<ConceptCode> concepts = new ArrayList<ConceptCode>(2);
    concepts.add(new ConceptCode("CO-123", new BigDecimal(125), "Dialy Hospital Bed Rate", 4));
    concepts.add(new ConceptCode("CO-123", new BigDecimal(100), "Nurse Service", 1));
    InsuranceService client = getClient();
    // Fixed rate for insured patients
    finalAmount = client.calculateHospitalRates(patientId, concepts);
    Map<String, Object> result = new HashMap<String, Object>();
    result.put("rates_finalAmount", finalAmount);
    result.put("rates_concepts", concepts);
    wim.completeWorkItem(wi.getId(), result);
}
Also used : ConceptCode(com.salaboy.jbpm5.dev.guide.model.ConceptCode) InsuranceService(com.salaboy.jbpm5.dev.guide.webservice.InsuranceService) HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) BigDecimal(java.math.BigDecimal)

Aggregations

InsuranceService (com.salaboy.jbpm5.dev.guide.webservice.InsuranceService)20 URL (java.net.URL)10 QName (javax.xml.namespace.QName)10 Service (javax.xml.ws.Service)10 MalformedURLException (java.net.MalformedURLException)9 ConceptCode (com.salaboy.jbpm5.dev.guide.model.ConceptCode)6 BigDecimal (java.math.BigDecimal)6 HashMap (java.util.HashMap)5 ExecutionResults (org.jbpm.executor.api.ExecutionResults)5 Patient (com.salaboy.jbpm5.dev.guide.model.Patient)4 ArrayList (java.util.ArrayList)4 List (java.util.List)2 PatientDataServiceWorkItemHandler (com.salaboy.jbpm5.dev.guide.workitems.PatientDataServiceWorkItemHandler)1