This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Does the work on each loop. | |
* @param {Number} [limit=10] - The number of records to process per loop. | |
* @param {Number} [currentNumber=0] - The number of records that have been processed so far, by all previous loops. | |
*/ | |
function eventWrapper(limit, currentNumber) { | |
var EVENT_NAME = 'EVENT.NAME.HERE'; //todo: Update this to the name of the event you've created. | |
var TABLE_NAME = 'TABLE_NAME_HERE'; //todo: Update this to the name of the table containing the records you're processing | |
var QUERY = 'some_query=here'; //todo: Put your query here |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Example1: | |
type: A | |
field: | |
Example2: | |
type: A | |
field: 2 | |
Example3: | |
type: B |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var ATFGraphQLAPI = { | |
atfTestToJson: function(test){ | |
return { | |
"active": test.getDisplayValue("active"), | |
"sys_id": test.getValue("sys_id"), | |
"name": test.getValue("name"), | |
"description": test.getValue("description") | |
}; | |
}, | |
atfTestResultToJson: function(testResult){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function process(/*ResolverEnvironment*/ env) { | |
var suite_id = env.getSource().sys_id.value; | |
var test_list_object = []; | |
var test; | |
var tests_in_suite = new GlideRecord("sys_atf_test_suite_test"); | |
tests_in_suite.addEncodedQuery("test_suite=" + suite_id); | |
tests_in_suite.query(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function process(/*ResolverEnvironment*/ env) { | |
var suite = new GlideRecord("sys_atf_test_suite"); | |
var sys_id = env.getArguments().id; | |
if(suite.get(sys_id)){ | |
return ATFGraphQLAPI.atfTestToJson(suite); | |
} | |
return; | |
})(env); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
schema { | |
query: Query | |
} | |
type Query { | |
atfTestSuite(id: String!): atfTestSuite | |
atfTest(id: String!): atfTest | |
} | |
type atfTestSuite { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var ATFGraphQLAPI = { | |
atfTestToJson: function(test){ | |
return { | |
"active": test.getDisplayValue("active"), | |
"sys_id": test.getValue("sys_id"), | |
"name": test.getValue("name"), | |
"description": test.getValue("description") | |
}; | |
}, | |
atfTestResultToJson: function(testResult){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function process(/*ResolverEnvironment*/ env) { | |
gs.info("getSource: " + JSON.stringify(env.getSource())); // sys_id | |
gs.info("getArguments: " + JSON.stringify(env.getArguments())); // limit | |
var limit = parseInt(env.getArguments().limit); | |
var test_id = env.getSource(); | |
var test_result = new GlideRecord("sys_atf_test_result"); | |
if(limit || limit>0) { | |
test_result.setLimit(limit); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
schema { | |
query: Query | |
} | |
type Query { | |
atfTest(id: String!): atfTest | |
} | |
type atfTest { | |
active: Boolean |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Script include: ATFGraphQLAPI | |
var ATFGraphQLAPI = { | |
""" | |
takes a glide record object and returns the data structure for an atfTest Schema object. | |
""" | |
atfTestToJson: function(test) { | |
return { | |
"active": test.getDisplayValue("active"), | |
"sys_id": test.getValue("sys_id"), | |
"name": test.getValue("name"), |
NewerOlder