Hear from Salesforce leaders on how to create and deploy Agentforce agents.
Contact Us 1-800-596-4880

SuccessFactors Connector - Mule 3

Anypoint Connector for SAP SuccessFactors (SuccessFactors Connector) provides full support to query, create, update, and delete entities using the SFAPI API exposed by SuccessFactors. For more information about the product, visit SAP SuccessFactors HCM Suite siteLeaving the Site.

Before You Begin

To use this information, you should be familiar with SAP SuccessFactors and have an SAP accountLeaving the Site. To use this connector, you need a working installation of Anypoint StudioLeaving the Site with the SuccessFactors connector installed.

Install the Connector

  1. In Anypoint Studio, click the Exchange icon in the Studio taskbar.

  2. Sign in to Exchange with your Anypoint Platform credentials.

  3. From Anypoint Exchange, click Provided by MuleSoft.

  4. Search for the Mule 3 connector and click Install.

Create a New Project

To use SuccessFactors Connector in a Mule app, first create a new Mule project in Anypoint Studio:

  1. In Anypoint Studio, click File > New > Mule Project.

  2. Enter a name for your new project and leave the remaining options with their default values.

  3. If you plan to use Git, select Create a .gitignore file for the project with default ignore settings for Studio Projects, and then click Next.

  4. Click Finish to create the project.

Namespace and Schema Location

When you drag a connector onto the Studio canvas, the configuration XML for your Mule app is populated with the namespace and schema.

Namespace:

xmlns:successfactors="http://www.mulesoft.org/schema/mule/successfactors"

Schema Location:

http://www.mulesoft.org/schema/mule/successfactors/current/mule-successfactors.xsd

If you are manually coding the Mule app in Studio’s XML editor or other text editor, define the namespace and schema location in the header of your Configuration XML, inside the <mule> tag.

To Configure a SuccessFactors Global Element with the Studio Visual Editor

  1. To use SuccessFactors Connector in your Mule app, configure a global configuration element that can be used by all SuccessFactors Connectors in the app.

  2. Click the Global Elements tab at the base of the canvas.

  3. On the Global Mule Configuration Elements screen, click Create.

  4. In the Choose Global Type wizard, expand Connector Configuration, and select Success Factors: Configuration.

  5. Click OK.

  6. Configure the parameters according to the instructions below.

    Global element properties window
    Field Description

    Name

    Enter a name for the configuration with which it can be referenced later.

    Username

    Username to log into SuccessFactors and access its API.

    Password

    Password for the username.

    Company ID

    ID of the organization in SuccessFactors which information you wish to manage.

    Connection Timeout

    Specifies the amount of time, in milliseconds, that the client attempts to establish a connection before it times out. 0 means attempt to open a connection indefinitely.

    Receive Timeout

    Specifies the amount of time, in milliseconds, that the client waits for a response before it times out. 0 means wait indefinitely.

    WSDL Location

    Location of the SFAPI SOAP 1.1 WSDL.

    Fetch all entities

    Check this if you wish to see the complete list of entities available for all operations. Building this list is a very slow process so checking this box is strongly discouraged. If you leave this unchecked, complete the Entity List.

    Entity List

    Required, if the Fetch All Entities box is not checked. Complete this with a list of names of all the entities you wish to work with.

  7. Click Test Connection and confirm receipt of the Connection Successful message.

  8. Click OK to save the global connector configurations.

To Configure a SuccessFactors Global Element with the XML Editor

  1. To use SuccessFactors Connector in your Mule app, configure a global configuration element that can be used by all SuccessFactors Connectors in the app.

  2. Include the SuccessFactors namespaces in your configuration file.

    <?xml version="1.0" encoding="UTF-8"?>
    
    <mule xmlns:successfactors="http://www.mulesoft.org/schema/mule/successfactors"
    xmlns="http://www.mulesoft.org/schema/mule/core"
    xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
      xmlns:spring="http://www.springframework.org/schema/beans"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://www.springframework.org/schema/beans
      http://www.springframework.org/schema/beans/spring-beans-current.xsd
    http://www.mulesoft.org/schema/mule/core
    http://www.mulesoft.org/schema/mule/core/current/mule.xsd
    http://www.mulesoft.org/schema/mule/successfactors http://www.mulesoft.org/schema/mule/successfactors/current/mule-successfactors.xsd">
    </mule>
    xml
  3. Create a global SuccessFactors configuration outside and above your flows using the following global configuration code.

    <successfactors:config name="Success_Factors__Configuration" username="${username}" password="${password}" companyId="${companyId}" wsdlLocation="${wsdlLocation}" doc:name="Success Factors: Configuration" fetchAllEntities="false">
            <successfactors:entity-list>
                <successfactors:entity-list>Goal$1</successfactors:entity-list>
                <successfactors:entity-list>picklistlabel</successfactors:entity-list>
                <successfactors:entity-list>picklistoption</successfactors:entity-list>
                <successfactors:entity-list>TrendData_sysOverallCompetency</successfactors:entity-list>
                <successfactors:entity-list>user</successfactors:entity-list>
            </successfactors:entity-list>
        </successfactors:config>
    xml
    Field Description

    Name

    Enter a name for the configuration with which it can be referenced later.

    Username

    Username to log into SuccessFactors and access its API.

    Password

    Password for the username.

    Company ID

    ID of the organization in SuccessFactors which information you wish to manage.

    Connection Timeout

    Specifies the amount of time, in milliseconds, that the client attempts to establish a connection before it times out. 0 means attempt to open a connection indefinitely.

    Receive Timeout

    Specifies the amount of time, in milliseconds, that the client waits for a response before it times out. 0 means wait indefinitely.

    WSDL Location

    Location of the SFAPI SOAP 1.1 WSDL.

    Fetch all entities

    Set this to true if you wish to see the complete list of entities available for all operations. Building this list is a very slow process so checking this box is strongly discouraged. If you set this to false, fill out the Entity List field.

    Entity List

    Required if the Fetch All Entities parameter is false. Enter a list of names of all the entities you wish to work with.

Using the Connector

For details on operations see the SuccessFactors connector technical referenceLeaving the Site and click the APIdoc for your connector version.

Using the Connector in a Mavenized Mule App

If you are coding a Mavenized Mule app, this XML snippet must be included in your pom.xml file.

<dependency>
  <groupId></groupId>
  <artifactId></artifactId>
  <version>x.y.z</version>
</dependency>
xml

Replace x.y.z with the version that corresponds to the connector you are using.

To obtain the most up-to-date pom.xml file information, access the connector in Anypoint ExchangeLeaving the Site and click Dependency Snippets.

SuccessFactor Connector Use Cases and Demos

The SuccessFactors Connector is an operation-based connector that allows you to invoke web service operations exposed by the SFAPI API.

This section of the manual provides a brief description of simple use case scenarios for this connector:

All of the example use cases are stored in one Mule app. See Flow XML for Use Cases.

List Entities Use Case

This flow retrieves the list of entities in your organization.

List entities flow

The connector itself does not require any additional configuration, apart from the operation to select:

List entities operation properties window

To test it, run the flow in Studio and open a browser window. Visit http://localhost:8081/Leaving the Site and click the List*button under the List Entities section to see the list of entities available.

Describe Entity Use Case

This flow retrieves all the available metadata from an entity in your organization.

Describe entities flow

The Describe entities operation only needs a list of strings corresponding to the entities you wish to retrieve the metadata for. In this example, this input is configured to take the payload sent to it by the preceding endpoint.

Describe entities operation properties window

In order to design the input for the connector, we use the Dataweave language made available through the Transform Message component. Its output is a list containing just one element, which is the query parameter 'entity' from the HTTP Connector.

Add the below DataWeave code to the DataWeave editor inside the Transform Message component.

%dw 1.0
%output application/java
---
[inboundProperties."http.query.params".'entity']
text

Run the flow in Studio to test this and open a browser window. Visit http://localhost:8081/Leaving the Site. Click on List under List Entities, then click on an entity name. Finally, click the Describe button under the Describe Entities section to see all the available metadata for the entity selected.

Query Use Case

This flow runs a query on Success Factors and shows the response.

Query flow

The Query operation needs a query and a page size.

You can either enter the native (SFQL) query language, or build it with the DataSense Query Builder.

Query builder window for query flow with fields selected

You can leave the page size at the default value.

Query operation properties window

To test this flow, run the flow in Mule Studio and open a browser window. Visit http://localhost:8081/query. You see the result of the query in the browser.

Upsert Use Case

This flow does the following:

  • Inserts a new User (or updates it, if it already exists).

  • Returns the output of the upsert.

Upsert flow

The SuccessFactors endpoint needs to be configured with the Upsert operation. First, select the type of the entity you wish to upsert, which in this example is a User. If the Type dropdown is not populated, click the refresh button on the right. The input structure is taken from the payload returned by DataWeave.

Upsert operation properties window

DataWeave turns the JSON object taken from the payload of the HTTP endpoint and converts it to a map, which is the input needed for the Upsert operation.

To test this flow, run the flow in Mule Studio and open a browser window. Enter http://localhost:8081/ and click the Submit button under the Upsert User section to see the result of the upsert operation in the browser.

Update Use Case

This flow does the following:

  • Updates a User with a new username.

  • Returns the output of the last update.

Update flow

The SuccessFactors endpoint needs to be configured with the Update operation. First, select the type of the entity you wish to update, which in this case is a User. If the Type dropdown is not populated, click the refresh button on the right. The input structure will be taken from the payload returned by DataWeave.

DataWeave turns the JSON object taken from the payload of the HTTP endpoint and converts it to a map, which is the input needed for the Update operation.

To test this flow, run the flow in Mule Studio and open a browser window. Visit http://localhost:8081/ and click the Submit button under the Update User section to see the result of the update operation in the browser. If you have already run the Upsert demo, the input for the Update job should have already been populated.

Insert Use Case

This flow inserts a new Goal$1 entity and returns the output of the insertion.

Insert flow

The SuccessFactors endpoint needs to be configured with the Insert operation. Select the type of the entity you wish to insert, which in this case is Goal$1. If the Type dropdown is not populated, click the refresh button on the right. The input structure will be taken from the payload returned by DataWeave.

Insert operation properties window

DataWeave turns the JSON object taken from the payload of the HTTP endpoint and converts it to a map, which is the input needed for the Insert operation.

To test this flow, run the flow in Mule Studio and open a browser window. Visit http://localhost:8081/ and click the Submit button under the Insert Goals section to see the result of the insert operation in the browser.

Delete Use Case

This flow deletes an existing Goal entity and returns the output of the deletion.

Delete flow

The SuccessFactors endpoint needs to be configured with the Delete operation. Select the type of the entity you wish to delete. If the Type dropdown is not populated, click the refresh button on the right. The input structure is taken from the payload returned by DataWeave.

Delete flow properties window

DataWeave turns the JSON object taken from the payload of the HTTP endpoint and converts it to a map, which is the input needed for the Delete operation:

DataWeave payload

To test this flow, run the flow in Mule Studio and open a browser window. Visit http://localhost:8081/ and click the Submit button under the Delete Goal section to see the result of the delete operation in the browser. If you have already run the Insert demo, the input for the Delete job should have already been populated.

Flow XML for Use Cases

Paste the below code into your XML Editor to run the use case examples.

View on GitHub