ConfigurationManager

Class

Perform operations on Workflow Manager configurations.

Refer to ManagerFactory.getManager to get a reference to this class.

Inheritance: ConfigurationManagerBaseManager

Methods

MethodReturnsNotes
Promise<string>

Evaluates an arcade expression.

Get all roles in the Workflow Manager system.

getDiagram(diagramId)

Get the details of a workflow diagram. This retrieves the latest active version of the diagram.

Promise<Diagram[]>

Get all the workflow diagrams in the Workflow Manager system.

getGroupRole(roleName)

Get the group role associated with a role name.

getGroupRoles(groupId)
Promise<string[]>

Get the roles associated with a group.

Promise<WorkflowGroup[]>

Get all the groups from the Workflow Manager system.

getJobTemplate(jobTemplateId)

Get a job template by job template id.

Promise<string[]>

Get the share details for a job template.

Promise<JobTemplate[]>

Get all the job templates in the Workflow Manager system.

getLookups(lookupType)
Promise<Lookup[]>

Get lookups by type.

Promise<string[]>

Get sharing details for a saved chart.

Promise<SavedChart[]>

Get the list of saved charts.

Promise<string[]>

Get sharing details for a saved search.

Promise<SavedSearch[]>

Get the list of saved searches.

getUser(username)

Get a user from the Workflow Manager system.

Promise<WorkflowUser[]>

Get all the users from the Workflow Manager system.

evaluateArcade

Class Method
evaluateArcade(paramsArcadeExpressionDetails): Promise<string>

Evaluates an arcade expression.

Refer to Dynamic Job Properties for a list of ArcGIS Arcade expressions that can be used in Workflow Manager.

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// Example 1:
// Evaluate an arcade expression for a job
const expression: ArcadeExpressionDetails = {
 expression: 'jobPriority($job)',
 parseMode: ArcadeParseMode.Standard,
 context: {
   jobId: 'job3'
 },
 contextType: ArcadeContextType.JobContext
};
const evaluatedString: string = await jobsManager.evaluateArcade(expression);

// Example 2:
// Evaluate an arcade expression not tied to a job
const expression: ArcadeExpressionDetails = {
 expression: 'GetUser($currentPortal)[\'email\']', // Get the current user's email
 parseMode: ArcadeParseMode.Standard,
 context: {},
 contextType: ArcadeContextType.BaseContext
};
const evaluatedString: string = await jobsManager.evaluateArcade(expression);
Parameters
ParameterTypeNotes
params
ArcadeExpressionDetails

Arcade expression property details to be evaluated.

Returns 
Promise<string>

The evaluated arcade expression.

getAllGroupRoles

Class Method
getAllGroupRoles(): Promise<WorkflowGroupRole[]>

Get all roles in the Workflow Manager system.

Use dark colors for code blocksCopy
1
2
3
4
5
const roles: WorkflowGroupRole[] = await configurationManager.getAllGroupRoles();
roles.forEach(role => {
 const rolePrivileges: string[] = role.privileges;
 console.log(`Role ${role.roleName}, description: ${role.description}, privileges: ${rolePrivileges.join()}`);
});
Returns 
Promise<WorkflowGroupRole[]>

List of group roles.

getDiagram

Class Method
getDiagram(diagramIdstring): Promise<DiagramDetails>

Get the details of a workflow diagram. This retrieves the latest active version of the diagram.

Use dark colors for code blocksCopy
1
2
3
4
const diagram: DiagramDetails = await configurationManager.getDiagram('diagramId4');
console.log(`Diagram ${diagram.diagramName}, isActive: ${diagram.active}, description: ${diagram.description}`);
const stepInfo: Step[] = diagram.steps;
const dataSources: DataSource[] = diagram.dataSources;
Parameters
ParameterTypeNotes
diagramId
string

The id of the diagram.

Returns 
Promise<DiagramDetails>

The diagram details.

getDiagrams

Class Method
getDiagrams(draftboolean): Promise<Diagram[]>

Get all the workflow diagrams in the Workflow Manager system.

Use dark colors for code blocksCopy
1
2
3
4
const diagrams: Diagram[] = await configurationManager.getDiagrams();
diagrams.forEach(diagram => {
 console.log(`Diagram ${diagram.diagramName}, isActive: ${diagram.active}, description: ${diagram.description}`);
});
Parameters
ParameterTypeDefaultNotes
draft
boolean
false

Boolean indicating whether to get the flag indicating if the diagram has a draft.

Returns 
Promise<Diagram[]>

List of all diagrams.

getGroupRole

Class Method
getGroupRole(roleNamestring): Promise<WorkflowGroupRole>

Get the group role associated with a role name.

Use dark colors for code blocksCopy
1
2
3
const role: WorkflowGroupRole = await configurationManager.getGroupRole('Workflow Designer');
const rolePrivileges: string[] = role.privileges;
console.log(`Role ${role.roleName}, description: ${role.description}, privileges: ${rolePrivileges.join()}`);
Parameters
ParameterTypeNotes
roleName
string

The name of the role.

Returns 
Promise<WorkflowGroupRole>

The group role associated with the role name.

getGroupRoles

Class Method
getGroupRoles(groupIdstring): Promise<string[]>

Get the roles associated with a group.

Parameters
ParameterTypeNotes
groupId
string

The id of the group.

Returns 
Promise<string[]>

List of role names associated with a group.

getGroups

Class Method
getGroups(): Promise<WorkflowGroup[]>

Get all the groups from the Workflow Manager system.

A Workflow Manager group is a portal group associated with Workflow Manager roles.

Use dark colors for code blocksCopy
1
2
3
4
const groups: WorkflowGroup[] = await configurationManager.getGroups();
groups.forEach(group => {
 console.log(`Group ${group.id}, name: ${group.name}`);
});
Returns 
Promise<WorkflowGroup[]>

List of groups.

getJobTemplate

Class Method
getJobTemplate(jobTemplateIdstring): Promise<JobTemplateDetails>

Get a job template by job template id.

Use dark colors for code blocksCopy
1
2
3
4
5
6
const jobTemplate: JobTemplateDetails = await configurationManager.getJobTemplate('jobTemplate1');
// Get some of the properties from the job template
const status: string = jobTemplate.defaultStatus;
const startDate: Date = jobTemplate.defaultStartDate;
const assignedTo: string = jobTemplate.defaultAssignedTo;
const diagramId: string = jobTemplate.diagramId;
Parameters
ParameterTypeNotes
jobTemplateId
string

The id of the job template.

Returns 
Promise<JobTemplateDetails>

The job template details.

getJobTemplateShareDetails

Class Method
getJobTemplateShareDetails(jobTemplateIdstring): Promise<string[]>

Get the share details for a job template.

Parameters
ParameterTypeNotes
jobTemplateId
string

The job template id to retrieve share details for.

Returns 
Promise<string[]>

List of group ids a job template has been shared with.

getJobTemplates

Class Method
getJobTemplates(): Promise<JobTemplate[]>

Get all the job templates in the Workflow Manager system.

Use dark colors for code blocksCopy
1
2
3
4
const jobTemplates: JobTemplate[] = await configurationManager.getJobTemplates();
jobTemplates.forEach(jobTemplate => {
 console.log(`Job Template ${jobTemplate.jobTemplateName}, state: ${jobTemplate.state}, diagram: ${jobTemplate.diagramName}`);
});
Returns 
Promise<JobTemplate[]>

List of job templates.

getLookups

Class Method
getLookups(lookupTypestring): Promise<Lookup[]>

Get lookups by type.

Use dark colors for code blocksCopy
1
2
3
4
const priorities: Lookup[] = await configurationManager.getLookups('priority');
priorities.forEach(priority => {
 console.log(`Priority ${priority.lookupName}, value: ${priority.value}`);
});
Parameters
ParameterTypeNotes
lookupType
string

The lookup type to retrieve. Options include status and priority .

Returns 
Promise<Lookup[]>

List of lookups of a given type.

getSavedChartSharingDetails

Class Method
getSavedChartSharingDetails(chartIdstring): Promise<string[]>

Get sharing details for a saved chart.

Use dark colors for code blocksCopy
1
const groupIds: string[] = await configurationManager.getSavedChartSharingDetails('chartId3');
Parameters
ParameterTypeNotes
chartId
string

The id of the chart to get sharing details for.

Returns 
Promise<string[]>

A list of groups that the saved chart is shared with.

getSavedCharts

Class Method
getSavedCharts(): Promise<SavedChart[]>

Get the list of saved charts.

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
const charts: SavedChart[] = await configurationManager.getSavedCharts();
charts.forEach(chart => {
 console.log(`Saved chart ${chart.name}, query: ${chart.definition}, colorRamp: ${chart.colorRamp}, `);
});

if (charts.length > 0) {
 // Get statistic data for a saved chart
 const chart: SavedChart = charts[0];
 const jobsManager = await ManagerFactory.getManager(JobsManager, options);
 const query: Query = chart.definition;
 const colorRamp: string = chart.colorRamp;
 // Query statistics for all open jobs and group by the first field in the saved chart
 const statisticDetails: JobStatisticsDetails = {
   q: 'closed=0',
   groupBy: query.fields[0]
 };
 const chartResults: JobStatistics = await jobsManager.calculateJobStatistics(chart.definition);
 // Use info from job statistics grouped values and the chart's color ramp to create a visible chart.
 // Refer to @arcgis/core/smartMapping/symbology/support/colorRamps for color ramp support
}
Returns 
Promise<SavedChart[]>

List of saved charts.

getSavedSearchSharingDetails

Class Method
getSavedSearchSharingDetails(searchIdstring): Promise<string[]>

Get sharing details for a saved search.

Use dark colors for code blocksCopy
1
const groupIds: string[] = await configurationManager.getSavedSearchSharingDetails('searchId3');
Parameters
ParameterTypeNotes
searchId
string

The id of the search to get sharing details for.

Returns 
Promise<string[]>

A list of groups that the saved search is shared with.

getSavedSearches

Class Method
getSavedSearches(): Promise<SavedSearch[]>

Get the list of saved searches.

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
const searches: SavedSearch[] = await configurationManager.getSavedSearches();
searches.forEach(search => {
 console.log(`Saved Search ${search.name}, searchType: ${search.searchType}, query: ${search.definition}`);
});

if (searches.length > 0) {
 // Run a saved search
 const search: SavedSearch = searches[0];
 const jobsManager = await ManagerFactory.getManager(JobsManager, options);
 const query: Query = search.definition;
 const searchResults = await jobsManager.queryJobs(search.definition);
}
Returns 
Promise<SavedSearch[]>

List of saved searches.

getUser

Class Method
getUser(usernamestring): Promise<WorkflowUserDetails>

Get a user from the Workflow Manager system.

Use dark colors for code blocksCopy
1
2
3
4
const userDetails: WorkflowUserDetails = await configurationManager.getUser('testuser');
const workflowRoles: string[] = userDetails.workflowRoles; // Roles associated with the user
const workflowPrivileges: string[] = userDetails.workflowPrivileges; // Privileges for the user
const groups: string[] = userDetails.groups; // Groups the user belongs to
Parameters
ParameterTypeNotes
username
string

The username of the user to retrieve.

Returns 
Promise<WorkflowUserDetails>

The user details for the user.

getUsers

Class Method
getUsers(): Promise<WorkflowUser[]>

Get all the users from the Workflow Manager system.

Use dark colors for code blocksCopy
1
2
3
4
5
const users: WorkflowUser[] = await configurationManager.getUsers();
// Do something with the users
users.forEach(user => {
 console.log(`User ${user.username}, fullname: ${user.fullName}, email: ${user.email}`);
});
Returns 
Promise<WorkflowUser[]>

List of users.

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.