YUCEL
YUCEL

Talking about my Salesforce.com and MuleSoft experience

Edgar Moran
Author

Software Engineer, passionate for tech stuff video and photography, Salesforce and Mulesoft developer

Share


Our Newsletter


Subscribe to get new post notifications.

* indicates required

Tags


Twitter


YUCEL

Integrate with Deltek Vision 76 using Mulesoft

Edgar MoranEdgar Moran

Mulesoft is one of the best integration platforms I ever used, and this time I'm using it to integrate with Deltek Vision. In this post I would like to cover the basic connection and a "how to" access to different actions in their API. I will explain:

  1. How to setup our Web Service Consumer connector to link Deltek Web Service and access to the API methods
  2. Setting the right attribute values calling an action to the API using DataWeave
  3. Create a Project

How to Setup Web Service Consumer

First, we need to locate the webservice provided for Deltek, in my case the people that use Deltek has the web service exposed in their server and the URL looks like this: https://customerServier.com/VISION/VisionWS.ASMX, we also should download the wsdl.xml version of this and place the file in our resources folder in the mule application.

  • Then we need to pick the Web Service Consumer connector in our canvas
  • Click on add Connector configuration and we should populate the fields is asking for it should be like this

Screen-Shot-2018-04-07-at-8.01.22-AM

In the WSDL Location, we need to point to the file in our resources folder. Service and Port will appear automatically

  • We need to setup a Http request reference that will allow to specify that our connection is made secure using HTTPS, so we need to click in the References tab, Select Http Configuration Reference and click on the plus sign to add this configuration and we set the attributes like this:

Screen-Shot-2018-04-07-at-8.08.08-AM

We can save those windows saving our changes, back in the connector we should be able to see all routines contained in the service:

Screen-Shot-2018-04-07-at-8.09.52-AM

Now we are ready to consume those methods

Setting the right attribute values calling an action to the API using DataWeave

Depending of what action we need to implement the attributes in the connector will change, but for example for Query a Project we need to have our DataWeave like this

%dw 1.0
%output application/xml
%namespace ns0 http://tempuri.org/Deltek.Vision.WebServiceAPI.Server/DeltekVisionOpenAPIWebService
---
{
	ns0#GetProjectsByQuery: {
		ns0#ConnInfoXML: flowVars.connectionHeaderVar,
		ns0#Query: "Select PR.* From PR where WBS1='100336'",
		ns0#RecordDetail: "WBS3"
	}
}

For the connectionInfoXML attribute we just need to have a reference flow to other DataWeave component that creates an XML. In this case we access to the properties file linked to our environment and we set

  • Database
  • user name
  • and Integrated Security
%dw 1.0
%output application/xml
---
{
	VisionConnInfo:{
		databaseDescription:p('deltek.database'),
		userName:p('deltek.username'),
		integratedSecurity:p('deltek.integratedSecurity')
	}
}

This will allow to make the Authentication process to Deltek and start the integration, this attribute should be set in all calls to the service.

Create a Project

To create a project we need:

  • We need to call connection header flow and then we are going to use this DataWeave script to set the XML payload to use it in the "Add Project" routine:
%dw 1.0
%output application/xml
---
{
	RECS @(xmlns:"http://deltek.vision.com/XMLSchema") :{
		REC :{
			PR @(name:'PR',alias:'PR',keys:'WBS1,WBS2,WBS3'):{
				ROW @(tranType:"INSERT"):{
					WBS1:flowVars.projectId,
					WBS2:"",
					WBS3:"",
					ChargeType:"",
					SubLevel:"N",
					Org:flowVars.organizationCode,
					OpportunityID:""
					
				}				
			}
		}		
	}
}

The WBS1(Project Level),WBS2(Site Level),WBS3(Division Level) are required, all elements and record are contained in the same PR (project) table

We need to specify Org as it represents the organization hierarchy (ORG:SOME:VALUE) and OpportunityId whould be there empty with the Sublevel and Charge Type.

This will represent the payload to create the project, now we need to set another Dataweave that will send both payloads, the connection header and the project add XML, and it will look like:

    %dw 1.0
%output application/xml
%namespace ns0 http://tempuri.org/Deltek.Vision.WebServiceAPI.Server/DeltekVisionOpenAPIWebService
---
{
	ns0#AddProject: {
		ns0#ConnInfoXML:flowVars.connectionHeader,
		ns0#DataXML: payload
	}
}

and my flow is:

Screen-Shot-2018-04-07-at-8.23.50-AM

To access to the service response you need to place another DataWeave component and you'll be able to access with:

    %dw 1.0
%output application/xml
%namespace ns0 http://tempuri.org/Deltek.Vision.WebServiceAPI.Server/DeltekVisionOpenAPIWebService
---
payload

Object to String or DOM to XML and you can access to the response and description

Hope this gives you an idea of how to integrate it and saves you some time.

Edgar Moran
Author

Edgar Moran

Software Engineer, passionate for tech stuff video and photography, Salesforce and Mulesoft developer

Comments