Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Work item calculated values using SOA call

Does anyone have implemented inside the attributes customization (calculated values) a SOA method using dojo?
We are trying to extract some information from a web service to include that inside the information of a work item.
Thanks in advance

0 votes

Comments

Hi, Miguel. Can you please provide some more details? Perhaps an example? All I can do is guess at the moment: it sounds like you want to call an (external?) web service from the JavaScript attribute customization of a work item.

This blog post describes how to use the HTTP filtered value provider to access data from  XML:http://jorgediazblog.wordpress.com/2012/06/27/work-item-customization-httpconector-and-oauth-in-rtc-4-0-for-oslc/ if your web service can be called using an URI and returns data the HTTP filtered value provider can access, you can use that in JavaScript - or even without JavaScript as described in Lab 4 here: https://jazz.net/library/article/1093.



5 answers

Permanent link
Hi to everyone:
I have a Remedy service (http://10.51.242.52/WsCAP-R/wsConParadigmRemedy.asmx?WSDL) where there are 6 operations, I´m only want to use one operation where I send a Remedy number and receive a detail of that Remedy number, I have created to new attributes to the defect work item, one the number and the other the description, inside the dojo script I extract the number from the defect work item to send that to the service, at this time I´m stuck to create the request for the service, this is the code:

dojo.provide("com.acme.providers.script.DetalleIncidenteScripted");
dojo.require("com.ibm.team.workitem.api.common.WorkItemAttributes");
dojo.require("dojox.xml.parser");

(function()
{
    var WorkItemAttributes = com.ibm.team.workitem.api.common.WorkItemAttributes;
    var StrNumeroIncidente = "0";//get number value
    var StrProveedor = "XXXXXXX";
    var StrPwd = "XXXXXXXX";
    var scriptname = "DetalleIncidenteScripted";
    var StrDetalle = new String("No se encontro detalle del Numero de Incidente. Favor de revisar el numero del incidente.");
    var StrServiceURL = "http://10.51.242.52/WsCAP-R/wsConParadigmRemedy.asmx?WSDL"; //service to invoke

    dojo.declare("com.acme.providers.script.DetalleIncidenteScripted", null,
    {
        getValue: function(attribute, workItem, configuration)
        {
            console.log(scriptname + " - Inicio js DetalleIncidenteScripted");
            StrNumeroIncidente = workItem.getValue("numeroIncidenteRemedy");
            console.log(scriptname + " Numero de Incidente Remedy: " + StrNumeroIncidente);
           
            if(StrNumeroIncidente==null || StrNumeroIncidente=="0") //validate the Remedy number
            {
                console.log(scriptname + " Numero incidente vacio");
                return StrDetalle;
            }
            else
            {
                console.log(scriptname + " Iniciando llamada a webservice");
                var soapMessage = new String(); // this is where I create the request with all the parameters

                if(window.XMLHttpRequest)//I don´t know if this will work, this is where I´m stuck
                {
                    httpRequest=new XMLHttpRequest();
                } else if (window.ActiveXObject)
                {
                    httpRequest=new ActiveXObject("Microsoft.XMLHTTP");
                }
                 
                httpRequest.open("POST",url,true);
               
                if (httpRequest.overrideMimeType)
                {
                    httpRequest.overrideMimeType("text/xml");
                }
               
                httpRequest.onreadystatechange=populateResponse;
                httpRequest.setRequestHeader("Man", url + " HTTP/1.1")
                httpRequest.setRequestHeader("MessageType", "CALL");
                httpRequest.setRequestHeader("Content-Type", "text/xml");
                httpRequest.send(soapMessage);
                valTimeout=setTimeout("timeout(httpRequest);",120000);
                return service.DetalleReporte.callService("DetalleReporte", StrNumeroIncidente, StrProveedor, StrPwd);//this is the call to the service, DetalleReporte is the operation that I will use
            }     
        }
    });
})();

I hope you can help me with this.
Regards

0 votes


Permanent link
I checked with a member of the Tracking and Planning team and this was his response: 

I don't believe it is possible. The assumption is that our script providers are sync operations which return the result directly. There is no way in JavaScript to block on a service call. What will happen is that you make the call and then continue execution and return null. When the service call returns with a value there will be no one listening to pick up that value.

You will likely need to follow Ralph's links and look at doing this via a server-side Java contribution.

0 votes


Permanent link
 Good afternoon, Miguel:

I would be interested in knowing more about your integration between BMC Remedy and JAZZ.  We are in the process of integrating the two right now, and your insight would likely prove useful.

Thank you
Glen Hartle
NAV CANADA
Ottawa, Canada
glen.hartle@navcanada.ca

0 votes


Permanent link
Why build the solution, it is already available at Project Remedies... plug and play, dashboard, etc
Stan Feinstein at c. 310-428-5748

0 votes


Permanent link
The solution have been already created by the IBM Software Services in the US, specifically the Rational team, if you can get in touch with this team they can help you to deliver the specific solution that you need.

0 votes

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,936
× 34

Question asked: Sep 26 '13, 1:03 p.m.

Question was seen: 6,867 times

Last updated: Jan 23 '14, 2:28 p.m.

Confirmation Cancel Confirm