It's all about the answers!

Ask a question

Work item calculated values using SOA call


Miguel Avila (155) | asked Sep 26 '13, 1:03 p.m.
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

Comments
Millard Ellingsworth commented Sep 27 '13, 12:53 p.m.
FORUM ADMINISTRATOR / JAZZ DEVELOPER

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.


Ralph Schoon commented Sep 30 '13, 8:08 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

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
Miguel Avila (155) | answered Jan 23 '14, 2:28 p.m.
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.

permanent link
Larry Biggs (1) | answered Jan 22 '14, 6:28 p.m.
Why build the solution, it is already available at Project Remedies... plug and play, dashboard, etc
Stan Feinstein at c. 310-428-5748

permanent link
Glen Hartle (111) | answered Jan 14 '14, 2:11 p.m.
 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

permanent link
Millard Ellingsworth (2.5k12431) | answered Oct 01 '13, 11:51 a.m.
FORUM ADMINISTRATOR / JAZZ DEVELOPER
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.

permanent link
Miguel Avila (155) | answered Sep 30 '13, 11:05 a.m.
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

Your answer


Register or 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.