Showing posts with label Oracle Field Service. Show all posts
Showing posts with label Oracle Field Service. Show all posts

Thursday, November 5, 2020

#805 OIC - Oracle Field Service via REST

 Yes, there is an Oracle Field Service Adapter in OIC and yes, it provides compelling functionality in respect of common use cases, such as the one described in the OFS adapter documentation -

This scenario describes the interaction between the Oracle Field Service and an application that receives and processes alerts for municipal services.

• A municipal employee receives an alert on the municipal services monitoring application indicating that there is a natural gas leak near a busy downtown intersection.

• The municipal employee creates a work order to dispatch a service team to the site. All details necessary to locate the natural gas leak are included in the work order.

• The municipal employee saves and submits the work order on the municipal services monitoring application.

• The work order is sent to the Oracle Field Service Adapter.

• The Oracle Field Service Adapter creates a matching activity in Oracle Field Service and returns the activity identifier to the municipal services monitoring application to allow the progress of the work order to be monitored.

• Oracle Field Service assigns the activity to the service team.

• The lead Engineer for the service team uses the mobile Oracle Field Service application to review the work order and identify the location of the natural gas leak.

• The service team repairs the natural gas leak and the lead Engineer uses the mobile Oracle Field Service application to change the status of the work order to completed.

• Oracle Field Service sends an activity completed notice for the work order to Oracle Field Service Adapter.

• The Oracle Field Service Adapter forwards the activity completed notice for the work order to the municipal services monitoring application.

• The municipal services monitoring application identifies the work order as resolved and it is closed

So what happens if I need to do something the adapter does not support?

In my case, customer wants to sync Capacity and Quota data to a 3rd Party system.

Enter the OIC REST adapter leveraging the OFS REST APIs.

The apis are detailed here














Capacity, for example, is not covered by the OFS adapter.

So let's check out how to leverage some of those apis via the REST adapter.












username is in the following format - applicationID@tenancy 

Here is mine from OFS - 











password is set the Client Secret.

Note, the error message - user is not permitted...

I check out bot's permissions in OFS - 










I click the +












I retry the Postman request and get over the permissions error -












Now time to read the docs - I need a dates parameter -













Ok, now let's get this working in OIC -

Connection Definition -













Here is the configuration of the connection in a scheduled integration -

















I set the Response to that from my Postman test -











Note the error - 









I amend the sample Response as follows - taking the Response from the REST API docs example -


 










The Mapping - 









Now to test -

















Thursday, March 5, 2020

#756 - OIC Oracle Field Service adapter --> Subscribing to OFS Events

Simple example here -
I want to trigger an OIC integration, when a new Resource is created in OFS.

A resource is one who does the actual work - so all hail our venerable resources!

OIC Trigger Configuration 

I drop the OFS connection as a Trigger and configure as follows -




OIC Processing Logic

In real life, the new resource details may need to be sent to a variety of downstream systems.
In my case, I simply write the data to a file via the OIC FTP adapter.






















Mapping is as follows -















I activate the integration.

I then create a Resource in OFS.


  
I do not see any integration running in OIC.
What's happening here?

Enable Event Publishing from OFS to OIC


Back to the OFS adapter documentation - a note to all autodidacts out there -
always good to read this before starting out -













































So there are some preparatory steps that have to be completed on OFS side
to enable event publishing to OIC.


Click Add Channel -












































Host is yourOIC-Host
Username is your OIC user

Channel is created - 












I create a new Resource -







































I go to OIC - Monitoring -




















I check the audit trail - there's Johanna -



OIC - THE integration platform for Oracle Field Service!

Tuesday, March 3, 2020

#755 OIC - Oracle Field Service Adapter















Like all OIC adapters, the OFS adapter has comprehensive documentation.
The users guide is available here

Pre-requisites 



There are some pre-requisites, which are discussed in the aforementioned doc -



















One also needs the client id / client secret from OFS.
















Users, Security, Integrations --> Applications -








Click on Show Client ID / Client Secret.

Note these values for future use.


Create the OFS Connection in OIC -


















Use client id / client secret as Username / Password.

Save and Test the connection -











Using the OFS Connection as a Trigger in an Integration


I can drop the OFS connection as a trigger - 















Here one can specify an OFS business object as the request payload -

























One can also respond to OFS events -



















Using the OFS Connection as an Invoke in an Integration
















Most of these Business Objects support CRUD activities.

Creating a New Activity via OIC


Target fields -









































and so on...

Valid activityTypes can be found in OFS -





















Now to re-iterate, I am a neophyte when it comes to OFS.
So how can I approach such a task?
Which fields do I need to fill?
Which values are valid?

My first port of call is the REST API docs for OFS.















I check out the example request payload -















I use this as the basis for the integration trigger, which is REST based -












































resourceId refers to the technician who will be assigned this activity.
I find this id in the OFS app -















customerName - I got this by browsing existing activities in OFS.

activityType - I set this to "Estimate", why Estimate? Why not? I don't know what's valid or not.
I test via Postman - and get the following error, which thankfully lists the valid types.






Now I try with furnace_repair - test and get a response containing the new activityId -













I check out the Dispatch Console in OFS -


























Anna is scheduled for furnace_repair on March 18th -
I hope all goes well!