Defines navigation for your application, which views trigger other views and which actions are called that trigger views.
Ximpia would query which view to show when actions are executed. You don’t need to code navigation for your application. When your flow changes, you update variables and flow parameters and your flow is changes (For example, to plug in a new view).
We define flow and simple navigation without conditions. You would register flow in components.py:
self._reg.registerFlow(__name__, flowCode='customer_provision')
self._reg.registerFlowView(__name__, flowCode='customer_provision',
viewNameSource='create_customer', viewNameTarget='customer_provisioned_profile_a',
actionName='activate_customer', condition="profile='corporate'")
self._reg.registerFlowView(__name__, flowCode='customer_provision',
viewNameSource='create_customer', viewNameTarget='customer_provisioned_profile_b',
actionName='activate_customer', condition="profile='smb'")
And then write flow variables in your service layer in action methods with correct decorator:
@workflow_action(forms.CustomerForm)
def activate_customer(self, customer_id, activation_code):
self._put_flow_params(profile='corporate')
Workflow would have enough info on which views to navigate to, depending on workflow variable profile. You may check for a number of conditions that all must match.
You can also:
In case the provided workflow is not enough for you, you can provide you own flow using provided methods in CommonService.
Displays view with a set of parameters. In case you need to have advanced workflows, you may redirect flows to views from your service actions.
Attributes
- view_name (str) : View name
- view_attrs (dict) : View attributes
Get flow params by list:
params = self._get_flow_params('status', 'profile')
Get workflow user. Allows for user id and dealing with advanced flows.
Build the flow data dictionary having the flowData instance
Attributes
- flow_data
Returns
flow_data_dict (dict)
Generate workflow user id.
Returns user_id (long)
Attributes
- flow_code (str)
Get flow
Returns
workflow:Workflow
Get flow data dictionary for user and flow code
Attributes
- wf_user_id
- flow_code
Returns
flow_data_dict (dict)
Get flow by action name. It queries the workflow data and returns flow associated with actionName
Attributes
- action_name
Returns
flow_view (WorkflowView)
Get workflow parameter value from context
Attributes
- name
Returns
parameter value (str)
Get flow parameter from context.
Attributes
- name
Returns
Parameter value
Get view from flow
Attributes
- wf_user_id
- flow_code
Returns
view (View)
Get view name
Get view flow parameters
Attributes
- flow_code
- view_name
Returns
params (dict) : {name: value, ... }
Is first view in flow?
Attributes
- flow_code
- view_name
Returns
True/False
Is last view in flow?
Attributes
- view_name_source
- view_name_target
- action_name
Returns
True/False
Put params in flow.
Attributes
keywork argumens
Remove user data from flow.
Attributes
- wf_user_id
- flow_code
Reset flow
Attributes
- wf_user_id
- flow_code
- view_name
Resolves flow for user and session key
Attributes
- wf_user_id
- flow_code
Returns
flow:WorkflowData
Search destiny views with origin viewSource and operation actionName
** Attributes **
- wf_user_id : Workflow user id
- app_name : App name
- flow_code : Flow code
- view_name_source : Origin view
- action_name : Action name
** Optional Attributes **
- flow_views (list<WorkflowView>) : List of flow views to check flow links from. No need to query for flow links.
** Returns ** flowView resolved, which represent flow link data
Save flow into data source
Attributes
- wf_user_id
- flow_code
Set view name
Attributes
- view_name