To complete the DescribeObjects orchestration, you map
outputs to input data, transform the object metadata to XML format
to conform to the ci-connector-api.xsd file, then
test the orchestration.
Procedure
- In the Studio Project toolbox tab, click on the DescribeObjects orchestration. The orchestration is displayed in the Studio workspace.
- In the orchestration, click on the Provide Service activity. The Map Outputs panel is displayed.
- In the Map Outputs panel, click on body. The node type window is displayed showing the input data.
- Add logic to the orchestration based on object and operation_name,
as shown in Figure 1 to obtain the object metadata.
Figure 1. DescribeObjects
- Transform the object
metadata to XML format to conform to the ci-connector-api.xsd file
described in App Connect CDK schema files. After the metadata is transformed to XML,
your schema looks like this:
< DescribeObjectResponse
baseType = "sObject"
baseTypeNS = "urn:sobject.partner.soap.sforce.com"
name = "create"
typeNS = "http://example.com/stockquote"
xmlns = "http://www.approuter.com/schemas/cdk/api/"
xmlns:con = "http://www.approuter.com/schemas/cdk/config/"
xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance" >
< object
label = "createInput"
maxCount = "1"
minCount = "1"
name = "createInput"
used = "true" >
< con:field
configurable = "true"
label = "ObjectName"
maxCount = "1"
minCount = "1"
name = "ObjectName"
used = "true" >
< con:type > string </ con:type >
</ con:field >
< con:field
configurable = "true"
label = "FirstName"
maxCount = "1"
minCount = "1"
name = "FirstName"
used = "true" >
< con:type > string </ con:type >
</ con:field >
< con:field
configurable = "true"
label = "LastName"
maxCount = "1"
minCount = "1"
name = "LastName"
used = "true" >
< con:type > string </ con:type >
</ con:field >
< con:field
configurable = "true"
label = "Phone"
maxCount = "1"
minCount = "1"
name = "Phone"
used = "true" >
< con:type > string </ con:type >
</ con:field >
</ object >
< responseObject
label = "createOutput"
maxCount = "1"
minCount = "1"
name = "createOutput"
used = "true" >
< con:field
configurable = "true"
label = "Id"
maxCount = "1"
minCount = "1"
name = "Id"
used = "true" >
< con:type > string </ con:type >
</ con:field >
< con:field
configurable = "true"
label = "ObjectName"
maxCount = "1"
minCount = "1"
name = "ObjectName"
used = "true" >
< con:type > string </ con:type >
</ con:field >
< con:field
configurable = "true"
label = "Status"
maxCount = "1"
minCount = "1"
name = "Status"
used = "true" >
< con:type > string </ con:type >
</ con:field >
</ responseObject >
</ DescribeObjectResponse >
- In the DescribeObjects orchestration, select the Send
Reply activity. The Map Inputs panel is displayed.
- In the Map Inputs panel, map the generated XML to the DescribeObjectResponse
parameter in the To Activity panel. You are now ready
to test the orchestration.
- In the orchestration, right-click on the Provide Service activity. The Verify Activity menu is displayed.
- In the Verify Activity menu, select Invoke Service. The Invoke Service window is displayed.
- In the Invoke Service window, enter the header and body
data and click Execute to start the test. To view the test
activity, click the Show Response button.
Results
When the test is completed, the results are displayed in the
Verify toolbox tab. If errors are present, make the necessary corrections,
then re-run the unit test.
What to do next
In the next phase, you learn how to publish your connector
project to a local repository.