BUILD_LIBRARY_FOR_DISTRIBUTION
to YES
.
pod install
FXConfig
which holds general purpose properties, and FXSessionConfig
which holds user session properties.
It is recommended to call the FXConfig
configuration method at app launch.
Call the FXSessionConfig configure method after the user logs in and a valid user session is available.
Name | Description | Type | Requirement |
---|---|---|---|
baseURL | The base URL used for REST networking | String | Mandatory |
enginePath | The process engine url path component | String | Mandatory |
imageBaseURL | The base URL used for static assets | String | Mandatory |
locale | The locale used for localization | String | Mandatory. Defaults to “en-us” |
language | The language used for retrieving enumerations and substitution tags | String | Mandatory. Defaults to “en” |
logLevel | Enum value indicating the log level logging. Default is none | Bool | Optional |
changeLocaleSettings
method:
Name | Description | Type |
---|---|---|
sessionManager | Alamofire session instance used for REST networking | Session |
token | JWT authentication access token | String |
FXSessionConfig
configure method was called with a valid session before setting up the theme.FXTheme
uuid
- the UUID of the theme configured in the FlowX Designer.
localFileUrl
- optional parameter for providing a fallback theme file, in case the fetch theme request fails.
completion
- a completion closure called when the theme setup finishes.
completion
parameter, FXTheme’s shared instance also provides a Combine publisher named themeFetched
which sends true
if the theme setup was finished.
FlowX.sharedInstance
.
checkRendererVersion
which has a completion handler containing a Bool value.
startSession()
method.
This is optional, as the session starts lazily when the first process is started.
FlowX.sharedInstance.startSession()
When you want to end a FlowX session, you can call the endSession()
method. This also does a complete clean-up of the started processes.
You might want to use this method in a variety of scenarios, for instance when the user logs out.
FlowX.sharedInstance.endSession()
UINavigationController
or UITabBarController
, depending on the BPMN diagram of the process.completion
closure parameter of the method.
projectId
- the uuid of the project
name
- the name of the process
params
- the start parameters, if any
isModal
- a boolean indicating whether the process navigation is modally displayed. When the process navigation is displayed modally, a close bar button item is displayed on each screen displayed throughout the process navigation.
showLoader
- a boolean indicating whether the loader should be displayed when starting the process.
completion
- a completion closure which passes either an instance of UINavigationController
or UITabBarController
to be presented.
onProcessEnded
- a closure called when the process ends. The closure is strongly referenced inside the SDK. Avoid reference cycles by using [weak self]
UINavigationController
.UINavigationController
.FXNavigationViewController
, which has the appearance set in the FlowX Theme, using the FXNavigationViewController
s class func FXNavigationViewController.navigationController()
.navigationController
- the instance of UINavigationController which will hold the process navigation stack
projectId
- the uuid of the project
name
- the name of the process
params
- the start parameters, if any
isModal
- a boolean indicating whether the process navigation is modally displayed. When the process navigation is displayed modally, a close bar button item is displayed on each screen displayed throughout the process navigation.
showLoader
- a boolean indicating whether the loader should be displayed when starting the process.
onProcessEnded
- a closure called when the process ends. The closure is strongly referenced inside the SDK. Avoid reference cycles by using [weak self]
UITabBarController
.UITabBarController
.tabBarController
- the instance of UITabBarController which will hold the process navigation
projectId
- the uuid of the project
name
- the name of the process
params
- the start parameters, if any
isModal
- a boolean indicating whether the process navigation is modally displayed. When the process navigation is displayed modally, a close bar button item is displayed on each screen displayed throughout the process navigation.
showLoader
- a boolean indicating whether the loader should be displayed when starting the process.
onProcessEnded
- a closure called when the process ends. The closure is strongly referenced inside the SDK. Avoid reference cycles by using [weak self]
UINavigationController
or UITabBarController
, depending on the BPMN diagram of the process.completion
closure parameter of the method.
name
- the name of the process
isModal
- a boolean indicating whether the process navigation is modally displayed. When the process navigation is displayed modally, a close bar button item is displayed on each screen displayed throughout the process navigation.
showLoader
- a boolean indicating whether the loader should be displayed when starting the process.
completion
- a completion closure which passes either an instance of UINavigationController
or UITabBarController
to be presented.
onProcessEnded
- a closure called when the process ends. The closure is strongly referenced inside the SDK. Avoid reference cycles by using [weak self]
UINavigationController
.UINavigationController
.FXNavigationViewController
, which has the appearance set in the FlowX Theme, using the FXNavigationViewController
s class func FXNavigationViewController.navigationController()
.uuid
- the UUID string of the process
name
- the name of the process
navigationController
- the instance of UINavigationController which will hold the process navigation stack
isModal
- a boolean indicating whether the process navigation is modally displayed. When the process navigation is displayed modally, a close bar button item is displayed on each screen displayed throughout the process navigation.
onProcessEnded
- a closure called when the process ends. The closure is strongly referenced inside the SDK. Avoid reference cycles by using [weak self]
UITabBarController
.UITabBarController
.uuid
- the UUID string of the process
name
- the name of the process
tabBarController
- the instance of UITabBarController which will hold the process navigation
isModal
- a boolean indicating whether the process navigation is modally displayed. When the process navigation is displayed modally, a close bar button item is displayed on each screen displayed throughout the process navigation.
onProcessEnded
- a closure called when the process ends. The closure is strongly referenced inside the SDK. Avoid reference cycles by using [weak self]
stopProcess(name: String)
method.
This is useful when you want to explicitly ask the FlowX shared instance to clean up the instance of the process sent as parameter.
For example, it could be used for modally displayed processes that are dismissed by the user, in which case the dismissRequested(forProcess process: String, navigationController: UINavigationController)
method of the FXDataSource will be called.
FXDataSource
protocol.
The data source is a public property of FlowX shared instance.
public weak var dataSource: FXDataSource?
func controllerFor(componentIdentifier: String) -> FXController?
func viewFor(componentIdentifier: String) -> FXView?
func viewFor(componentIdentifier: String, customComponentViewModel: FXCustomComponentViewModel) -> AnyView?
func navigationController() -> UINavigationController?
UINavigationController
class, or just a regular UINavigationController
instance themed by the container app.
func errorReceivedForAction(name: String?)
func validate(validatorName: String, value: String) -> Bool
func dismissRequested(forProcess process: String, navigationController: UINavigationController)
func viewForStepperHeader(stepViewModel: StepViewModel) -> AnyView?
func collect(event: AnalyticsEvent)
AnalyticsEvent
enum, which can represent a screen or an action.
func newProcessStarted(processInstanceUuid: String)
START_PROJECT
action. The parameter is the uuid of the process instance. The container app is responsible for dismissing the navigation of the current process and displaying the new process navigation.
internal(set) public var data: Any?
data
is the property, containing the data model for the custom component. The type is Any, as it could be a primitive value, a dictionary or an array, depending on the component configuration.
internal(set) public var actions: [ProcessActionModel]?
actions
is the array of actions provided to the custom component.
func titleForScreen() -> String?
func populateUI()
func updateUI()
UIView
instances. Similar to FXController
it has data and actions properties and a populate method.
var data: [String: Any]?
data
is the property, containing the data model for the custom view. The type is Any, as it could be a primitive value, a dictionary or an array, depending on the component configuration.
var actions: [ProcessActionModel]?
actions
is the array of actions provided to the custom view.
func populateUI()
FXCustomComponentViewModel
is a class implementing the ObservableObject
protocol. It is used for managing the state of custom SwiftUI views.
It has two published properties, for data and actions. It also includes a saveData
dictionary and a validate
closure used for submitting and validating data from the custom components.
public var saveData: [String: Any]?
Used for setting data to be submitted from the custom component.
public var validate: (() -> Bool)?
Used for validating the custom component data before executing the action.
FXDataSource
protocol method viewForStepperHeader
.
The method has a parameter, which provides the data needed for populating the view’s UI.
action
- the ProcessActionModel
action object
params
- the parameters for the action
action
- the ProcessActionModel
action object
image
- the image to upload
action
- the ProcessActionModel
action object
fileURL
- the local URL of the image
collect(event: AnalyticsEvent)
func of the FXDataSource
protocol needs to be implemented.
The func will be called by the SDK each time a screen or an action analytics event occurs.
The type of the event and relevant metadata are included in the func parameter event
which is a AnalyticsEvent
enum case.
func updateAuthorization(token: String)
method.