cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
824
Views
0
Helpful
9
Replies

Need clarifications on NB Web services

esramasa
Cisco Employee
Cisco Employee

Hi All,

We are trying to utilize the web services exposed by the CPO 3.0. However we are stuck with following topics/questions and not able to move forward. The intention of this, is basically to trigger/observe/stop/review activities from a custom portal similar to Cisco Prime catalog. We have referred NB Web Services guide, but it doesn't explain in detail

 

  • Process Level - How to accomplish a custom web service (Our definition of custom is a feature offered as part of CPO but not available as a web service) along with the guidelines of parameterizing techniques which is not been elaborated in the NB_Web Services Guide (available online along with WSDL).
    • Example - Guidelines to create a new web service Process by name startUpdateDatabase(parameter1, parameter2,…... parameter n)
  • Instance Level - Development documentation of web service which can give the exact node status of the current instance running
    • Anticipated return statement similar to currentExecutionNode - (node n) where n is the node ID/name of the requested instance
  • Tasks Level - Lifecycle documentation associated to tasks
    • Example - ItilStatus(ItilTaskStatus) - Status of Task (New, assigned, pending, InProgress ….. Etc.,) - Understanding of the complete lifecycle but not just parameters. How to obtain?
  • Sample code to perform tasks like InputTask and ApprovalTask which involves user effort (say, approving an action) using web services and when the task is performed by an user, the status of the flow of information changes from assigned to completed.
  • Are there any Web Services development guide with examples(Apart from NB Web Services Guide)?

 

 

Any help would be much appreciated . 

 

Thank you!

Regards,

Eswar

 

9 Replies 9

Shaun Roberts
Cisco Employee
Cisco Employee

ok... I'll give it a whirl.

As a side note, you should be able to use something like SOAP UI if you are trying to easily form the calls. You can use SOAP UI and connect to whatever WSDL in the NBWS you want and it will give you all the methods and you can create sample calls and try them out. This is shown quite a bit in my blogs. For web service work, my blogs are a great place to start.

 

  1. Process Level - I believe what you are asking here is how to get something to start via NBWS? In 3.0 you must add the trigger "Started by Web Service". There you can configure the exposed name/method for that web service. After saving your process you must refresh/bounce the web services and then your process will show up in the process WSDL (by default: http://host:port/WS/Process?WSDL). You can then make calls to it.
  2. I believe you are asking how to find the status of a current process? Or are you asking about the exact status of a CPO node in the cluster? If it's the process, you can use the process instance WSDL @ http://hostname:port/WS/ProcessInstance?WSDL. If you are asking about finding the status of a CPO node, then you can query the DB for that or you could just use the windows activity "Query Service" and query for the CPO Service to be running. You would have to write this yourself but it's quite easy. (in fact I probably have a blog showing it somewhere) There is *NO* webservice to give back the status of a CPO node's service
  3. Not sure what you are asking about tasks. You can use the NBWS for them in http://host:port/WS/Task?WSDL . The lifecycle of a tasks should meet that of the ITIL model as that is what CPO is patterned after. We do not offer training on this lifecycle, that would be something you would fine with ITIL training. Many of the customers (who are not ITIL trained) only use a couple of status and go with it because it means something to them. IE. Some only used CLOSED to close out tasks, but some used RESOLVED. It's really up to end user determination.
  4. I would create the task via web service and then update it with the proper information. Again, like I mentioned above, if you need to see samples or the layout of one, then use SOAP UI. It will give you a template layout and then you can fill in the required information. We do not have a sample of every single web call we produce. (since SOAP UI does such a great job) You can also use the WEB SERVICE EXECUTE activity inside of CPO and this gives you inputs to do it directly (although does not give you the soap message like SOAP UI does)
  5. No. The NBWS guide is it. Use SOAP UI as per above. I have done a numerous amount of blogs that have some information in them and have some examples, but I have not done everything because the use case has not crossed my desk.

 

If you have more pointed use case and what exactly you are trying to do we can go into further detail maybe, but the above is a good start.

 

--Shaun

--Shaun Roberts
Principal Engineer, CX
shaurobe@cisco.com

Thanks Shaun. It is helpful. With respect to tasks, need a clarity on the web service usage. For example, consider a process with 3 tasks

First Task- Get User inputs

Second Task - Approval task

Third Task -Create user Task

 

If I need to  know the status of all the above three tasks and also update it via web service , how to do it? May be I'll put the query like this , how  to check the status of  approval task and approve it  using web service?

Thanks!

Regards,

Eswar

Each tasks properties could be viewed via their method calls for view.

 

Method name:

ViewApprovalTaskProperties

etc

Create User task? all tasks are considered User Tasks.

 

You could update them via their update methods:

ie: UpdateApprovalTask

 

So you could check and approve via those methods I would imagine. Never done this before but I think quite doable.

 

Does your custom portal not have any built-in approval facilities? I know CPSC does.

 

Food for thought.

 

good luck!

 

--shaun

--Shaun Roberts
Principal Engineer, CX
shaurobe@cisco.com

Shaun,

 

Thanks for your inputs. Yup, our custom portal doesn't support built-in approval facilities. Also cannot go with CPSC, at this point in time

With your inputs , I could understand using ViewApprovalTaskProperties() , we can view the properties and status . But how do I get the specific Instance ID of the task ? While designing the process, when a task is dragged and dropped, guess it is mapped with a GUID. Also when ever a process is triggered , each tasks present inside also gets an associated instance ID(Note: Am referring to Task Instance ID , not the Process Instance ID). How to get it, so that I can pass it to ViewApprovalTaskProperties() and get the status ?

 

Regards,

Eswar

If you create via the process itself using like "Create alert" or "create whatever" it exposes the GUID as the Task ID in the process. (see attached image)

 

If you are doing via create in the web services I would imagine the web service call returns the GUID. (it does for targets and processes)

 

--Shaun Roberts
Principal Engineer, CX
shaurobe@cisco.com

Thanks Shaun. To understand better, are there any differences between Task ID and Activity Instance ID? Because I have noticed that , TaskID is getting created during the design of the process. But the activity Instance ID is assigned/generated for every trigger of the process.  My doubt is, should we pass the TaskID or Activity Instance ID  to view the properties of approval task? Find the attached snapshot for your reference

Task ID -> this is the GUID the refers to the USER TASK (alert/incident/etc) that you create. It is unique per user task

 

 

Activity Instance ID -> this refers to the activity CREATE ALERT or CREATE INCIDENT or whatever. This is referring to the activity itself and *NOT* the Task.

 

 

You should use the Task ID to refer or find the task you create in the system.

--Shaun Roberts
Principal Engineer, CX
shaurobe@cisco.com

esramasa
Cisco Employee
Cisco Employee

Thanks Shaun, but how to get the Task ID through web service call?. It is changing for every instance of process triggered

There is no call to get back a GUID of a task.

 

Depending on how your process is you could save it as an output variable of your process and then get that through the process instance WSDL. You could also publish it via SNMP trap or to the event log and have your application read that. You could also publish it to a flat file or output file and read from that.

 

What really matters is how your other application needs to consume it and then you'll have to write the interface around that.

--Shaun Roberts
Principal Engineer, CX
shaurobe@cisco.com