Skip to content

Commit

Permalink
Bamboohr connector usecase template (#367)
Browse files Browse the repository at this point in the history
* Adding Usecase Templates for BambooHR

* Adding Instruction Files for BambooHR Connector

* Update template-metadata.json

* Update template-metadata.json

* Delete resources/Create an employee in BambooHR on creating an employee in freshteam.yaml

* Delete resources/markdown/Create an employee in BambooHR on creating an employee in freshteam_instructions.md

* Update template-metadata.json

* Corrections

---------

Co-authored-by: Deepak Ayilliath <[email protected]>
  • Loading branch information
prafullmahajan and Deepak-Ayilliath authored Sep 14, 2023
1 parent e44934b commit 4d6e3c2
Show file tree
Hide file tree
Showing 5 changed files with 402 additions and 0 deletions.
184 changes: 184 additions & 0 deletions resources/Create a new form entry in Wufoo from BambooHR.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,184 @@
$integration: http://ibm.com/appconnect/integration/v2/integrationFile
integration:
type: api
trigger-interfaces:
trigger-interface-1:
triggers:
createEmployeeReports:
assembly:
$ref: '#/integration/assemblies/assembly-1'
input-context:
data: EmployeeReports
output-context:
data: EmployeeReports
options:
resources:
- business-object: EmployeeReports
model:
$ref: '#/models/EmployeeReports'
triggers:
create: createEmployeeReports
type: api-trigger
action-interfaces:
action-interface-1:
type: api-action
business-object: reports
connector-type: bamboohr
actions:
CREATEREPORT: {}
action-interface-2:
type: api-action
business-object: FormEntry
connector-type: wufoo
actions:
CREATE: {}
assemblies:
assembly-1:
assembly:
execute:
- custom-action:
name: bambooHR Request a custom report
target:
$ref: '#/integration/action-interfaces/action-interface-1'
action: CREATEREPORT
map:
mappings:
- format:
template: '{{$Request.format}}'
- inputfields:
expression: '$Request.fields '
$map: http://ibm.com/appconnect/map/v1
input:
- variable: Request
$ref: '#/trigger/payload'
- variable: flowDetails
$ref: '#/flowDetails'
- for-each:
name: For each
assembly:
$ref: '#/integration/assemblies/assembly-2'
source:
expression: '$bambooHRRequestacustomreport.employees '
input:
- variable: Request
$ref: '#/trigger/payload'
- variable: bambooHRRequestacustomreport
$ref: >-
#/node-output/bambooHR Request a custom
report/response/payload
- variable: flowDetails
$ref: '#/flowDetails'
mode: sequential
continue-on-error: true
map:
$map: http://ibm.com/appconnect/map/v1
customSchemas:
properties.`output`:
type: object
properties:
firstName:
type: string
input:
- variable: Foreachitem
$ref: '#/block/For each/current-item'
- variable: Request
$ref: '#/trigger/payload'
- variable: bambooHRRequestacustomreport
$ref: >-
#/node-output/bambooHR Request a custom
report/response/payload
- variable: flowDetails
$ref: '#/flowDetails'
mappings:
- output:
mappings:
- firstName:
template: '{{$Foreachitem.firstName}}'
display-name: bambooHR employees
- response:
name: response-1
reply-maps:
- title: EmployeeReports successfully created
status-code: 201
map:
$map: http://ibm.com/appconnect/map/v1
input:
- variable: Request
$ref: '#/trigger/payload'
- variable: bambooHRRequestacustomreport
$ref: >-
#/node-output/bambooHR Request a custom
report/response/payload
- variable: Foreach
$ref: '#/node-output/For each/response/payload'
- variable: flowDetails
$ref: '#/flowDetails'
mappings:
- result:
template: '{{$Foreach.output}}'
input: []
assembly-2:
assembly:
execute:
- create-action:
name: Wufoo Create form entry
target:
$ref: '#/integration/action-interfaces/action-interface-2'
map:
mappings:
- Field1:
template: '{{$Foreachitem.firstName}}'
- Field16:
template: '{{$Foreachitem.employeeNumber}}'
- Field17:
template: '{{$Foreachitem.middleName}}'
- Field18:
template: '{{$Foreachitem.maritalStatus}}'
- Field2:
template: '{{$Foreachitem.lastName}}'
- Field22:
template: '{{$Foreachitem.workPhone}}'
- Field24:
template: '{{$Foreachitem.gender}}'
- Field26:
template: '{{$Foreachitem.employmentHistoryStatus}}'
- Field27:
template: '{{$Foreachitem.workEmail}}'
- Field29:
template: '{{$Foreachitem.supervisorId}}'
- Hash:
template: q1h28nis04w3mqu
$map: http://ibm.com/appconnect/map/v1
input:
- variable: Foreachitem
$ref: '#/block/For each/current-item'
- variable: Request
$ref: '#/trigger/payload'
- variable: bambooHRRequestacustomreport
$ref: >-
#/node-output/bambooHR Request a custom
report/response/payload
- variable: flowDetails
$ref: '#/flowDetails'
name: Create a new form entry in Wufoo from BambooHR
models:
EmployeeReports:
name: EmployeeReports
properties:
result:
required: false
id: true
type: string
fields:
required: false
id: false
type:
- string
format:
required: false
id: false
type: string
plural: EmployeeReports
description: ' '
operations:
create: '#/integration/assemblies/assembly-1'
Original file line number Diff line number Diff line change
@@ -0,0 +1,182 @@
$integration: http://ibm.com/appconnect/integration/v2/integrationFile
integration:
type: trigger-action
trigger-interfaces:
trigger-interface-1:
connector-type: streaming-connector-scheduler
type: event-trigger
triggers:
SCHEDULE:
input-context:
data: scheduler
assembly:
$ref: '#/integration/assemblies/assembly-1'
options:
subscription:
scheduleConfiguration:
interval:
unit: minute
value: 1
runOnceOncheck: false
days:
- MON
- TUE
- WED
- THU
- FRI
- SAT
- SUN
timeZone: UTC
action-interfaces:
action-interface-1:
type: api-action
business-object: employees
connector-type: bamboohr
actions:
RETRIEVEALL: {}
action-interface-2:
type: api-action
business-object: employees
connector-type: bamboohr
actions:
RETRIEVEALL: {}
action-interface-5:
type: api-action
business-object: mail
connector-type: gmail
actions:
CREATE: {}
assemblies:
assembly-1:
assembly:
execute:
- retrieve-action:
name: bambooHR Retrieve employees
target:
$ref: '#/integration/action-interfaces/action-interface-1'
filter:
where:
and:
- type: inserted
- since: '{{$Trigger.lastEventTime}}'
input:
- variable: Trigger
$ref: '#/trigger/payload'
- variable: flowDetails
$ref: '#/flowDetails'
limit: 10
allow-truncation: true
allow-empty-output: true
- for-each:
name: For each
assembly:
$ref: '#/integration/assemblies/assembly-2'
source:
expression: '$bambooHRRetrieveemployees '
input:
- variable: Trigger
$ref: '#/trigger/payload'
- variable: bambooHRRetrieveemployees
$ref: '#/node-output/bambooHR Retrieve employees/response/payload'
- variable: bambooHRRetrieveemployeesMetadata
$ref: '#/node-output/bambooHR Retrieve employees/response'
- variable: flowDetails
$ref: '#/flowDetails'
mode: sequential
continue-on-error: true
map:
$map: http://ibm.com/appconnect/map/v1
customSchemas:
properties.`output`:
type: object
properties:
firstName:
type: string
lastName:
type: string
id:
type: string
input:
- variable: Foreachitem
$ref: '#/block/For each/current-item'
- variable: Trigger
$ref: '#/trigger/payload'
- variable: If
$ref: '#/block/For each/node-output/If/response/payload'
- variable: bambooHRRetrieveemployees
$ref: '#/node-output/bambooHR Retrieve employees/response/payload'
- variable: bambooHRRetrieveemployeesMetadata
$ref: '#/node-output/bambooHR Retrieve employees/response'
- variable: flowDetails
$ref: '#/flowDetails'
mappings:
- output:
mappings:
- id:
template: '{{$Foreachitem.id}}'
display-name: bambooHR employees
assembly-2:
assembly:
execute:
- retrieve-action:
name: bambooHR Retrieve employees 2
target:
$ref: '#/integration/action-interfaces/action-interface-2'
filter:
where:
id: '{{$Foreachitem.id}}'
input:
- variable: Foreachitem
$ref: '#/block/For each/current-item'
- variable: Trigger
$ref: '#/trigger/payload'
- variable: bambooHRRetrieveemployees
$ref: '#/node-output/bambooHR Retrieve employees/response/payload'
- variable: bambooHRRetrieveemployeesMetadata
$ref: '#/node-output/bambooHR Retrieve employees/response'
- variable: flowDetails
$ref: '#/flowDetails'
limit: 10
allow-truncation: true
allow-empty-output: true
- create-action:
name: Gmail Send email
target:
$ref: '#/integration/action-interfaces/action-interface-5'
map:
mappings:
- Body:
template: |-
Hi,
Please find the employee details created in BambooHR:
EmployeeID: {{$bambooHRRetrieveemployees2.id}}
FirstName : {{$bambooHRRetrieveemployees2.firstName}}
LastName : {{$bambooHRRetrieveemployees2.lastName}}
- CC:
template: [email protected]
- Subject:
template: '{{$Foreachitem.id}} - Created In BambooHR Portal'
- To:
template: [email protected]
$map: http://ibm.com/appconnect/map/v1
input:
- variable: Foreachitem
$ref: '#/block/For each/current-item'
- variable: Trigger
$ref: '#/trigger/payload'
- variable: bambooHRRetrieveemployees2
$ref: >-
#/block/For each/node-output/bambooHR Retrieve employees
2/response/payload
- variable: bambooHRRetrieveemployees2Metadata
$ref: >-
#/block/For each/node-output/bambooHR Retrieve employees
2/response
- variable: bambooHRRetrieveemployees
$ref: '#/node-output/bambooHR Retrieve employees/response/payload'
- variable: bambooHRRetrieveemployeesMetadata
$ref: '#/node-output/bambooHR Retrieve employees/response'
- variable: flowDetails
$ref: '#/flowDetails'
name: Send an email notification on creating an employee in BambooHR
models: {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
To refer to these instructions while editing the flow, open [the GitHub page](https://github.com/ot4i/app-connect-templates/blob/master/resources/markdown/Create%20a%20new%20form%20entry%20in%20Wufoo%20from%20BambooHR_instructions.md)(opens in a new window).

1. Click **Create flow** to start using the template.
1. Click **Operations**, then click **Edit flow** to edit the operations.
1. Click the BambooHR node, and if you're not already connected, connect to your [BambooHR account](https://www.ibm.com/docs/en/app-connect/containers_cd?topic=apps-bamboohr).
1. Click the Wufoo node, and if you're not already connected, connect to your [Wufoo account](https://www.ibm.com/docs/en/app-connect/containers_cd?topic=apps-wufoo).
1. Click **Done**.
1. To start the flow, in the banner click **Start flow**.

For more information about this flow, see the tutorial [Creating flows for an API](https://www.ibm.com/docs/en/app-connect/saas?topic=designer-introduction-creating-flows-api-part-1).
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
To refer to these instructions while editing the flow, open [the GitHub page](https://github.com/ot4i/app-connect-templates/blob/master/resources/markdown/Send%20an%20email%20notification%20on%20creating%20an%20employee%20in%20BambooHR_instructions.md) (opens in a new window).

1. Click **Create flow** to start using the template.
1. Connect to the following accounts by using your credentials:
- [BambooHR](https://www.ibm.com/docs/en/app-connect/containers_cd?topic=apps-bamboohr)
- [Gmail](https://www.ibm.com/docs/en/app-connect/containers_cd?topic=apps-gmail)
1. To start the flow, in the banner, click **Start flow**.

Loading

0 comments on commit 4d6e3c2

Please sign in to comment.