Class
Perform operations on Workflow Manager configurations.
Refer to ManagerFactory.getManager to get a reference to this class.
Methods
Method | Returns | Notes |
---|---|---|
evaluateArcade(params) | Promise<string> | Evaluates an arcade expression. |
Promise<WorkflowGroupRole[]> | Get all roles in the Workflow Manager system. | |
getDiagram(diagramId) | Promise<DiagramDetails> | Get the details of a workflow diagram. This retrieves the latest active version of the diagram. |
getDiagrams(draft) | Promise<Diagram[]> | Get all the workflow diagrams in the Workflow Manager system. |
getGroupRole(roleName) | Promise<WorkflowGroupRole> | 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) | Promise<JobTemplateDetails> | Get a job template by job template id. |
getJobTemplateShareDetails(jobTemplateId) | 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. |
getSavedChartSharingDetails(chartId) | Promise<string[]> | Get sharing details for a saved chart. |
Promise<SavedChart[]> | Get the list of saved charts. | |
getSavedSearchSharingDetails(searchId) | Promise<string[]> | Get sharing details for a saved search. |
Promise<SavedSearch[]> | Get the list of saved searches. | |
getUser(username) | Promise<WorkflowUserDetails> | Get a user from the Workflow Manager system. |
getUsers() | Promise<WorkflowUser[]> | Get all the users from the Workflow Manager system. |
evaluateArcade
Class MethodevaluateArcade(params: ArcadeExpressionDetails): 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.
// 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
Parameter | Type | Notes |
---|---|---|
params | ArcadeExpressionDetails | Arcade expression property details to be evaluated. |
Returns
Promise<string>
The evaluated arcade expression.
getAllGroupRoles
Class MethodgetAllGroupRoles(): Promise<WorkflowGroupRole[]>
Get all roles in the Workflow Manager system.
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 MethodgetDiagram(diagramId: string): Promise<DiagramDetails>
Get the details of a workflow diagram. This retrieves the latest active version of the diagram.
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
Parameter | Type | Notes |
---|---|---|
diagram | string | The id of the diagram. |
Returns
Promise<DiagramDetails>
The diagram details.
getDiagrams
Class MethodgetDiagrams(draft: boolean): Promise<Diagram[]>
Get all the workflow diagrams in the Workflow Manager system.
const diagrams: Diagram[] = await configurationManager.getDiagrams();
diagrams.forEach(diagram => {
console.log(`Diagram ${diagram.diagramName}, isActive: ${diagram.active}, description: ${diagram.description}`);
});
Parameters
Parameter | Type | Default | Notes |
---|---|---|---|
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 MethodgetGroupRole(roleName: string): Promise<WorkflowGroupRole>
Get the group role associated with a role name.
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
Parameter | Type | Notes |
---|---|---|
role | string | The name of the role. |
Returns
Promise<WorkflowGroupRole>
The group role associated with the role name.
getGroupRoles
Class MethodgetGroupRoles(groupId: string): Promise<string[]>
Get the roles associated with a group.
Parameters
Parameter | Type | Notes |
---|---|---|
group | string | The id of the group. |
Returns
Promise<string[]>
List of role names associated with a group.
getGroups
Class MethodgetGroups(): Promise<WorkflowGroup[]>
Get all the groups from the Workflow Manager system.
A Workflow Manager group is a portal group associated with Workflow Manager roles.
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 MethodgetJobTemplate(jobTemplateId: string): Promise<JobTemplateDetails>
Get a job template by job template id.
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
Parameter | Type | Notes |
---|---|---|
job | string | The id of the job template. |
Returns
Promise<JobTemplateDetails>
The job template details.
getJobTemplateShareDetails
Class MethodgetJobTemplateShareDetails(jobTemplateId: string): Promise<string[]>
Get the share details for a job template.
Parameters
Parameter | Type | Notes |
---|---|---|
job | 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 MethodgetJobTemplates(): Promise<JobTemplate[]>
Get all the job templates in the Workflow Manager system.
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 MethodgetLookups(lookupType: string): Promise<Lookup[]>
Get lookups by type.
const priorities: Lookup[] = await configurationManager.getLookups('priority');
priorities.forEach(priority => {
console.log(`Priority ${priority.lookupName}, value: ${priority.value}`);
});
Parameters
Parameter | Type | Notes |
---|---|---|
lookup | string | The lookup type to retrieve. Options include |
Returns
Promise<Lookup[]>
List of lookups of a given type.
getSavedChartSharingDetails
Class MethodgetSavedChartSharingDetails(chartId: string): Promise<string[]>
Get sharing details for a saved chart.
const groupIds: string[] = await configurationManager.getSavedChartSharingDetails('chartId3');
Parameters
Parameter | Type | Notes |
---|---|---|
chart | 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 MethodgetSavedCharts(): Promise<SavedChart[]>
Get the list of saved charts.
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 MethodgetSavedSearchSharingDetails(searchId: string): Promise<string[]>
Get sharing details for a saved search.
const groupIds: string[] = await configurationManager.getSavedSearchSharingDetails('searchId3');
Parameters
Parameter | Type | Notes |
---|---|---|
search | 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 MethodgetSavedSearches(): Promise<SavedSearch[]>
Get the list of saved searches.
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 MethodgetUser(username: string): Promise<WorkflowUserDetails>
Get a user from the Workflow Manager system.
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
Parameter | Type | Notes |
---|---|---|
username | string | The username of the user to retrieve. |
Returns
Promise<WorkflowUserDetails>
The user details for the user.
getUsers
Class MethodgetUsers(): Promise<WorkflowUser[]>
Get all the users from the Workflow Manager system.
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.