Defines navigation for your application, which views trigger other views and which actions are called that trigger views.
You would need:
Actions: Flow navigation is triggered by action components. You need to define actions that will navigate to other views.
with register methods and define flows with variable values.
Label methods: Include decorator into your views and actions to let ximpia know they must follow flows.
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='login')
self._reg.registerFlowView(__name__, flowCode='login', viewNameSource=Views.LOGIN,
viewNameTarget=Views.HOME_LOGIN, actionName='login', order=10)
And then write flow variables in your service layer in action methods:
self._put_flow_params(my_var='Customer')
Workflow would have enough info on which views to navigate to.
WorkFlow.
Ximpia comes with a basic application workflow to provide navigation for your views.
Navigation is provided in window and popup window types.
You “mark” as workflow view any service method with flow code (decorator). Actions are also “marked” as worflow actions with decorators.
When actions are triggered by clicking on a button or similar, action logic is executed, and user displays view based on flow information and data inserted in the flow by actions. You do not have to map navigation inside your service operations.
Plugging in a new view is pretty simple. You code the service view operation, include it in your flow, and view (window or popup) will be displayed when requirements are met
Attributes
user visits again any page in the flow. * deleteOnEnd:BooleanField : Flow data is deleted when user gets to final view in the flow. * jumpToView:BooleanField : When user visits first view in the flow, will get redirected to last visited view in the flow. User jumps to last view in the flow.
Relationships
WorkFlow View. Relationship between flows and your views.
Source view triggers action, logic is executed and target view is displayed to user.
Attributes
between those values, like 15, for example.
Relationships
displayed. * params <-> Param through WFParamValue with related name ‘flowView_params’
User Workflow Data
userId is the workflow user id. Flows support authenticated users and anonymous users. When flows start, in case not authenticated, workflow user id is generated. This feature allows having a flow starting at non-authenticated views and ending in authenticated views, as well as non-auth flows.
Attributes
Relationships
Service methods that deal with workflow are:
Put parameters into workflow or navigation system. @param args: Arguments to insert into persistence
Build the flow data dictionary having the flowData instance. @param flowData: Flow data @return: flow_data_dict
Get flow data dictionary for user and flow code @param wf_user_id: Workflow user id @param flow_code: flowCode @return: flow_data_dict : Dictionary
Get flow by action name. It queries the workflow data and returns flow associated with actionName @param action_name: Action name @return: flow_view: Workflow view
Get flow parameter from context. @param name: Parameter name @return: Parameter value
Get view from flow @param wf_user_id: User @param flow_code: Flow code @return: view_name
Get view entry parameters for view and flow @param flow_code: Flow code @param view_name: View name @return: param_dict
Checks if view is first in flow. It uses field ‘order’ to determine if is first view.
Checks if view is last in flow.
Put list of workflow parameters in context @param argsDict: Argument dictionary
Reset flow. It deletes all workflow variables and view name @param wf_user_id: Workflow User Id @param flow_code: Flow code
Resolves flow for user and session key. @param wf_user_id: Workflow User Id @param flow_code: Flow code @return: resolved_flow : Resolved flow for flow code , login user or session
Search destiny views with origin viewSource and operation actionName @param view_name_source: Origin view @param action_name: Action name @return: view_target