Jump to content

Recommended Posts

Posted

Hi @Victor @Steve G

Apologies for the tagging but I am having an issue with kicking of a BPM with an API

So far I have this: 

image.thumb.png.d72cbbf675dae082a94cbb45b812b669.png

It logs the request fine, against the correct service and CI, but there is no BPM assigned to it.

The catalog item is set up with a BPM and the service has the same BPM set as the default under SRs

Any ideas where we are going wrong?

Posted

Ah ok. I was confused by the API description of serviceId:

Quote
serviceId xs:string optional The id of the selected service. This will be used to spawn a bpm process.

No worries, I'll have a look at logRequestBPM then. 

Thanks @Victor

Posted

@Dan Munns oh... hmm.... I see... well... the API itself does not spawn a BP so either the description is incorrect or the API needs to be redesigned to do the spawn... I'll take this with dev team

Meanwhile, logRequestBPM would do the trick...

  • Thanks 1
Posted

@Victor if the API could kick off a BP  from either serviceId or catalogId (depending on lowest level set) that would be great. 

In the mean time we will look at logRequestBPM :) 

Thanks! 

Posted
Just now, Dan Munns said:

if the API could kick off a BP  from either serviceId or catalogId (depending on lowest level set) that would be great

That's what logRequestBPM does... but yeah...

Posted
Just now, Dan Munns said:

Would just mean that I didn't have to log a request, get the reference number then kick off the BPM.

Yep, that's all that's needed ;) 

Posted

I know. But at the moment it takes around 30 - 50 seconds from kicking off the api to the call logging to complete. Then I have to invoke the BPM.

If it could all be done at once it would just be...neater

  • Like 1
Guest Ehsan
Posted

@Dan Munns,

Instead of invoking logRequest method, I would advise you to refer to the methods below (depending on the Request type you intend to raise)...

These methods will automatically kick off logRequest and logRequestBPM, so you don't have to chain the APIs in your code.

By providing serviceId to any one of these methods, the Business Process that is associated to the supplied Service will be spawned, otherwise you can override the Business Process used via bpmName parameter.

Hope this helps.

Ehsan

 

  • 6 months later...
Posted

Hi @Ehsan

Im trying to utilize the LogServiceRequest api call. 
But im struggeling with the serviceID. to spawn the BPM process with it. 


no matter what i put in there results in "no service " warning. 
"summary": "Audit -> Test",
"warnings": "{\"noService\":\"The Request has no service so no valid business process available\"}"

Even with or without the actual  <bpmName>se-service-request-process</bpmName>


Where can in find the correct id to use ? 

Thanks Martijn

 

On 6/26/2019 at 3:24 PM, Ehsan said:

Instead of invoking logRequest method, I would advise you to refer to the methods below (depending on the Request type you intend to raise)...

These methods will automatically kick off logRequest and logRequestBPM, so you don't have to chain the APIs in your code.

By providing serviceId to any one of these methods, the Business Process that is associated to the supplied Service will be spawned, otherwise you can override the Business Process used via bpmName parameter.

Hope this helps.

Ehsan

 

 

Posted

@Martijn,

Through the main menu > Service Manager Tile > Service Portfolio Tile, open the Service that you would like to raise the Request against. In the URL, you'll be able to find the If of the Service.

An example as below.

image.png

 

Posted

mine is Id 7, if i put that in the No Service warning remains,

it also does not pickup the BPM when posting it with the BPMName Tage in the xml.

Thanks Marijn

Posted

@Ehsan

Also tried on the Demo instance, same result there. 

47 minutes ago, Martijn said:

mine is Id 7, if i put that in the No Service warning remains,

it also does not pickup the BPM when posting it with the BPMName Tage in the xml.

Thanks Martijn

Posted

@Martijn,

Could you please confirm that you've supplied serviceId and bpmName parameters?

Posted

Hi @Ehsan

yes, i use both the ServiceID and the BPM Name variables. 
 

<methodCall service="apps/com.hornbill.servicemanager/ServiceRequests" method="logServiceRequest">
<params>
<summary>Audit -> Test</summary>
<description>Test</description>
<requestType>Service Request</requestType>
<customerId>m1</customerId>
<customerType>0</customerType>
<ownerId>md1</ownerId>
<teamId>SE/DEP_IS/TM_IS_HFD/</teamId>
<status>status.new</status>
<priorityId>16</priorityId>
<categoryId>229</categoryId>
<categoryName>Scheduled Request</categoryName>
<sourceType>Post</sourceType>
<sourceId>Admin</sourceId>
<!--<Impact></Impact>-->
<!--<Urgency></Urgency>-->
<serviceID>7</serviceID>
<!--<Questions></Questions>-->
<!--<ResolutionDetails></ResolutionDetails>-->
<siteId>1</siteId>
<siteName>Office</siteName>
<CatalogID>83</CatalogID>-->
<CatalogName>Audit</CatalogName>
<bpmName>se-service-request-process</bpmName>
</params>
</methodCall>


 

Posted

@Martijn,

In your payload, I can see reference to "serviceID"; The parameter must be declared as "serviceId".

Also, please note that "catalogID" should be declared as "CatalogId". I also noticed that there is a trailing HTML comment left at the end of that line.

When declaring parameters, please ensure that the case is respected as the XMLMC library enforces this check.

image.png

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...