Static Util Objects
Functions
configurePromiseUI(type, converterFn)
Registers a converter function that converts the generic result data based on types originating from a given generic java-type or GraphQL type.
Parameters
Name | Type | Description |
---|---|---|
type | String | Fully qualified generic type or GraphQL type to register the option converter for |
converterFn | Function | options converter converting instance of the type to react-toastify options |
equalsScalar(scalarType, a, b)
Returns true when the given scalar values are equal. The equality rules are scalar type dependent. Many scalar types use instance equality ( === ), while e.g. the Date based types compare time stamps.
Parameters
Name | Type | Description |
---|---|---|
scalarType | String | scalar type name |
a | * | scalar value a |
b | * | scalar value b |
getCurrentProcess()
Returns the current top-level process.
Return Value
Type: Processthe current process on top
getGenericType(typeName)
Looks up the generic type the type with the given name is based on.
Parameters
Name | Type | Description |
---|---|---|
typeName | String | type name |
Return Value
Type: String | nullfull qualified generic type name or null
getWireFormat()
Returns the wireFormat instance created by the system (or tests)
Return Value
Type: WireFormatwire format
graphql(params, params.query, params.variables, params.autoConvert)
GraphQL query service. Executes the given GraphQL query with the given variables. By default it will automatically perform a wire format conversions. The variables are converted from Javascript format to the current wire format and the result received is being converted from wire format to Javascript. You can pass in a param `autoConvert: false` to disable that behavior.
Parameters
Name | Type | Description |
---|---|---|
params | Object | Parameters |
params.query | String | query string |
params.variables | Object | query variables |
params.autoConvert | Object | if false, don't convert input and result ( default is true) |
mapIterator(map)
Calls the given callback once for every entry in a ES6 Map and return all return values as array
Parameters
Name | Type | Description |
---|---|---|
map | Map | input map |
openDialog(renderFn)
Opens a dialog using the given render function. The render function receives a dialog API object with which the rendered content can control the dialog.
Parameters
Name | Type | Description |
---|---|---|
renderFn | Function | render function ( dialog => react element ) |
pickSchemaTypes(inputSchema, typeNames)
Filters a raw input schema JSON structure to only include the types reachable by a given list of type names as starting points.
Parameters
Name | Type | Description |
---|---|---|
inputSchema | object | inputSchema or other object containing a "schema" and a "meta" property. |
typeNames | Array<String> | types to start at. Queries and Mutations can be referenced by prefixing the method name with "q:" or "m:" (e.g. "q:iQueryFoo") |
printSchema(schema, newLine)
Renders a human-readable GraphQL schema from a JSON schema introspection including the automaton-specific additions.
Parameters
Name | Type | Description |
---|---|---|
schema | Object | (automaton) schema data |
newLine | String | newLine to use |
promiseUI(promise)
Wrapper for GraphQL-data promises that renders UI messages/"toasts" for a given promise. Allows for control of messages by registering option converter functions for generic types.
Parameters
Name | Type | Description |
---|---|---|
promise | Promise | promise, usually a graphql query |
registerCustomFilter(name, filterFn)
Register new filter alias
Parameters
Name | Type | Description |
---|---|---|
name | String | filter alias |
filterFn | function | String | filter function or name to be executed if filter is applied |
registerCustomFilterRenderer(name, filterFn)
Register new filter renderer alias
Parameters
Name | Type | Description |
---|---|---|
name | String | filter renderer alias |
filterFn | function | String | filter renderer function or name to be executed if filterRenderer is applied |
registerFKSelectorFilterAndRenderer(name, query, rootType, sourceName, modalTitle, valueFieldName)
Register a filter renderer for an FKSelector
Parameters
Name | Type | Description |
---|---|---|
name | String | filter renderer alias |
query | Object | the query used for the FKSelector |
rootType | String | the table that the FKSelector works on |
sourceName | String | path of the FKSelector inside the table |
modalTitle | String | title of the FKSelectorModal |
valueFieldName | String | the value of the FKSelector table used by the filter |
shutdown()
Deregisters the necessary handlers and shuts down the running automaton app.
startup(ctx, processImporter, initial, initFn)
Entry point to the automaton client-side process engine
Parameters
Name | Type | Description |
---|---|---|
ctx | ------ | require.context with all domain .js files |
processImporter | function | dynamic import process loader (name => module ) |
initial | Object | initial data pushed from server |
initFn | Function | init callback |
Return Value
Type: ReactElementinitial component output
uri(location)
Formats a local URI with path patterns and parameters.
Parameters
Name | Type | Description |
---|---|---|
location | String | local location e.g. "/app/process/{name}" |