Tizen Native API  9.0
MMI Workflow

The MMI Workflow API provides functions for creating MMI workflow modules.

Required Header

#include <mmi-workflow.h>

Overview

The MMI Workflow API provides functions to manage workflows in the MMI framework. Workflows consist of nodes connected together to form a graph representing a series of actions executed in response to certain data flows, events, or conditions.
This API set allows you to:

  • create/destroy workflows
  • set/get the standard type of a workflow
  • add nodes to a workflow
  • link nodes together by specifying input and output ports
  • assign attributes to nodes within a workflow
  • set default values for attributes
  • assign signals to nodes within a workflow
  • associate workflow output with a specific node and port
  • register standard workflows
  • create custom workflows from scripts

Functions

int mmi_workflow_create (mmi_workflow_h *workflow)
 Creates a new workflow prototype.
int mmi_workflow_set_type (mmi_workflow_h workflow, mmi_standard_workflow_type_e type)
 Sets the type of a workflow prototype.
int mmi_workflow_get_type (mmi_workflow_h workflow, mmi_standard_workflow_type_e *type)
 Gets the type of a workflow prototype.
int mmi_workflow_node_add (mmi_workflow_h workflow, const char *node_name, mmi_node_h node)
 Adds a node to a workflow prototype.
int mmi_workflow_link_nodes_by_names (mmi_workflow_h workflow, const char *from_node_name, const char *from_port_name, const char *to_node_name, const char *to_port_name)
 Links two nodes in a workflow prototype using their names and port names.
int mmi_workflow_attribute_assign (mmi_workflow_h workflow, const char *attribute_name, const char *target_node_name, const char *target_attribute_name)
 Assigns an attribute of a workflow to an attribute of a specific node.
int mmi_workflow_attribute_set_default_value (mmi_workflow_h workflow, mmi_attribute_h default_value)
 Sets the default value of an attribute of a workflow.
int mmi_workflow_signal_assign (mmi_workflow_h workflow, const char *signal_name, const char *target_node_name, const char *target_signal_name)
 Assigns a signal of a workflow to a signal of a specific node in a workflow prototype.
int mmi_workflow_output_assign (mmi_workflow_h workflow, const char *workflow_output, const char *out_node_name, const char *node_out_port_name)
 Assigns an output of a workflow to a OUT port of a specific node in a workflow prototype.
int mmi_workflow_output_assign_by_port (mmi_workflow_h workflow, const char *workflow_output, mmi_port_h port)
 Assigns an output of a workflow to a OUT port of a specific node in a workflow prototype using a port handle.
int mmi_standard_workflow_register (mmi_workflow_h workflow)
 Registers a standard workflow prototype to the workflow manager.
int mmi_workflow_clone (mmi_workflow_h workflow, mmi_workflow_h *cloned)
 Clones a workflow.
int mmi_workflow_create_from_script (const char *script, mmi_workflow_h *workflow)
 Creates a workflow prototype from a script.
int mmi_workflow_destroy (mmi_workflow_h workflow)
 Destroys a workflow prototype.

Typedefs

typedef struct mmi_workflow_s * mmi_workflow_h
 Handle for MMI workflow prototypes.

Typedef Documentation

typedef struct mmi_workflow_s* mmi_workflow_h

Handle for MMI workflow prototypes.

This handle represents a workflow prototype created within the MMI framework.

Since :
9.0

Enumeration Type Documentation

Enumeration for standard MMI workflows.

This enumeration defines the different types of standard workflows supported by the MMI framework.

Since :
9.0
Enumerator:
MMI_STANDARD_WORKFLOW_NONE 

Indicates that no standard workflow is selected.

MMI_STANDARD_WORKFLOW_VOICE_TOUCH 

Indicates the Voice Touch workflow.


Function Documentation

Registers a standard workflow prototype to the workflow manager.

This function registers a standard workflow prototype to the workflow manager for further use.

Since :
9.0
Parameters:
[in]workflowThe handle to the workflow prototype to register.
Returns:
0 on success, otherwise a negative error value.
Return values:
MMI_ERROR_NONESuccessful
MMI_ERROR_NOT_SUPPORTEDNot supported
MMI_ERROR_INVALID_PARAMETERInvalid parameter
MMI_ERROR_OUT_OF_MEMORYOut of memory
See also:
mmi_workflow_h
int mmi_workflow_attribute_assign ( mmi_workflow_h  workflow,
const char *  attribute_name,
const char *  target_node_name,
const char *  target_attribute_name 
)

Assigns an attribute of a workflow to an attribute of a specific node.

This function assigns a workflow attribute to a target attribute of a specific node in the workflow prototype.

Since :
9.0
Parameters:
[in]workflowThe handle of the workflow prototype.
[in]attribute_nameThe name of the workflow attribute to be assigned.
[in]target_node_nameThe name of the target node.
[in]target_attribute_nameThe name of the target attribute in the node.
Returns:
0 on success, otherwise a negative error value.
Return values:
MMI_ERROR_NONESuccessful
MMI_ERROR_NOT_SUPPORTEDNot supported
MMI_ERROR_INVALID_PARAMETERInvalid parameter
See also:
mmi_attribute_h

Sets the default value of an attribute of a workflow.

This function sets the default value for a workflow attribute.

Since :
9.0
Parameters:
[in]workflowThe handle of the workflow prototype.
[in]default_valueThe handle of the default value to be set.
Returns:
0 on success, otherwise a negative error value.
Return values:
MMI_ERROR_NONESuccessful
MMI_ERROR_NOT_SUPPORTEDNot supported
MMI_ERROR_INVALID_PARAMETERInvalid parameter
See also:
mmi_attribute_h
int mmi_workflow_clone ( mmi_workflow_h  workflow,
mmi_workflow_h cloned 
)

Clones a workflow.

This function creates a clone of the specified workflow.

Since :
9.0
Remarks:
The cloned should be released using mmi_workflow_destroy().
Parameters:
[in]workflowThe handle to the workflow to clone.
[out]clonedA pointer to store the handle of the cloned workflow.
Returns:
0 on success, otherwise a negative error value.
Return values:
MMI_ERROR_NONESuccessful
MMI_ERROR_NOT_SUPPORTEDNot supported
MMI_ERROR_INVALID_PARAMETERInvalid parameter
MMI_ERROR_OUT_OF_MEMORYOut of memory
Example
   #include <mmi.h>
   ...
   mmi_workflow_h workflow; // Indicates the handle of the workflow
   mmi_workflow_h cloned = NULL;
   mmi_workflow_clone(workflow, &cloned);
   ...
   mmi_workflow_destroy(cloned);
See also:
mmi_workflow_h
int mmi_workflow_create ( mmi_workflow_h workflow)

Creates a new workflow prototype.

This function allocates memory for a new workflow prototype and returns its handle.

Since :
9.0
Remarks:
The workflow should be released using mmi_workflow_destroy().
Parameters:
[out]workflowA pointer to store the handle of the newly created workflow prototype.
Returns:
0 on success, otherwise a negative error value.
Return values:
MMI_ERROR_NONESuccessful
MMI_ERROR_NOT_SUPPORTEDNot supported
MMI_ERROR_INVALID_PARAMETERInvalid parameter
MMI_ERROR_OUT_OF_MEMORYOut of memory
Example
   #include <mmi.h>
   ...
   mmi_workflow_h workflow = NULL;
   mmi_workflow_create(&workflow);
   ...
   mmi_workflow_destroy(workflow);
See also:
mmi_workflow_destroy()
int mmi_workflow_create_from_script ( const char *  script,
mmi_workflow_h workflow 
)

Creates a workflow prototype from a script.

This function creates a workflow prototype from the provided script.

Since :
9.0
Remarks:
The workflow should be released using mmi_workflow_destroy().
Parameters:
[in]scriptThe script to create the workflow prototype from.
[out]workflowA pointer to store the handle of the created workflow prototype.
Returns:
0 on success, otherwise a negative error value.
Return values:
MMI_ERROR_NONESuccessful
MMI_ERROR_NOT_SUPPORTEDNot supported
MMI_ERROR_INVALID_PARAMETERInvalid parameter
MMI_ERROR_OUT_OF_MEMORYOut of memory
Example
   #include <mmi.h>
   ...
   mmi_workflow_h workflow = NULL;
   mmi_workflow_create_from_script("@workflow", &workflow);
   ...
   mmi_workflow_destroy(workflow);
See also:
mmi_workflow_h

Destroys a workflow prototype.

This function destroys the specified workflow prototype.

Since :
9.0
Parameters:
[in]workflowThe handle to the workflow prototype to destroy.
Returns:
0 on success, otherwise a negative error value.
Return values:
MMI_ERROR_NONESuccessful
MMI_ERROR_NOT_SUPPORTEDNot supported
MMI_ERROR_INVALID_PARAMETERInvalid parameter
MMI_ERROR_OUT_OF_MEMORYOut of memory
See also:
mmi_workflow_h

Gets the type of a workflow prototype.

This function retrieves the standard workflow type assigned to the given workflow prototype.

Since :
9.0
Parameters:
[in]workflowThe handle of the workflow prototype.
[out]typeA pointer to store the retrieved standard workflow type.
Returns:
0 on success, otherwise a negative error value.
Return values:
MMI_ERROR_NONESuccessful
MMI_ERROR_NOT_SUPPORTEDNot supported
MMI_ERROR_INVALID_PARAMETERInvalid parameter
See also:
mmi_standard_workflow_type_e
mmi_workflow_set_type()
int mmi_workflow_link_nodes_by_names ( mmi_workflow_h  workflow,
const char *  from_node_name,
const char *  from_port_name,
const char *  to_node_name,
const char *  to_port_name 
)

Links two nodes in a workflow prototype using their names and port names.

This function links the output port of one node to the input port of another node.

Since :
9.0
Parameters:
[in]workflowThe handle of the workflow prototype.
[in]from_node_nameThe name of the source node.
[in]from_port_nameThe name of the output port of the source node.
[in]to_node_nameThe name of the destination node.
[in]to_port_nameThe name of the input port of the destination node.
Returns:
0 on success, otherwise a negative error value.
Return values:
MMI_ERROR_NONESuccessful
MMI_ERROR_NOT_SUPPORTEDNot supported
MMI_ERROR_INVALID_PARAMETERInvalid parameter
See also:
mmi_node_h
int mmi_workflow_node_add ( mmi_workflow_h  workflow,
const char *  node_name,
mmi_node_h  node 
)

Adds a node to a workflow prototype.

This function adds a node with a given name to the workflow prototype.

Since :
9.0
Parameters:
[in]workflowThe handle of the workflow prototype.
[in]node_nameThe name of the node to be added.
[in]nodeThe handle of the node to be added.
Returns:
0 on success, otherwise a negative error value.
Return values:
MMI_ERROR_NONESuccessful
MMI_ERROR_NOT_SUPPORTEDNot supported
MMI_ERROR_INVALID_PARAMETERInvalid parameter
See also:
mmi_node_h
int mmi_workflow_output_assign ( mmi_workflow_h  workflow,
const char *  workflow_output,
const char *  out_node_name,
const char *  node_out_port_name 
)

Assigns an output of a workflow to a OUT port of a specific node in a workflow prototype.

This function assigns an output from a workflow to a target OUT port of a specific node in the workflow prototype.

Since :
9.0
Parameters:
[in]workflowThe handle to the workflow.
[in]workflow_outputThe name of the output to assign.
[in]out_node_nameThe name of the target node where the output will be assigned.
[in]node_out_port_nameThe name of the target OUT port in the target node.
Returns:
0 on success, otherwise a negative error value.
Return values:
MMI_ERROR_NONESuccessful
MMI_ERROR_NOT_SUPPORTEDNot supported
MMI_ERROR_INVALID_PARAMETERInvalid parameter
MMI_ERROR_OUT_OF_MEMORYOut of memory
See also:
mmi_workflow_h
int mmi_workflow_output_assign_by_port ( mmi_workflow_h  workflow,
const char *  workflow_output,
mmi_port_h  port 
)

Assigns an output of a workflow to a OUT port of a specific node in a workflow prototype using a port handle.

This function assigns an output from a workflow to a target OUT port of a specific node in the workflow prototype using a port handle.

Since :
9.0
Parameters:
[in]workflowThe handle to the workflow.
[in]workflow_outputThe name of the output to assign.
[in]portThe handle to the target port where the output will be assigned.
Returns:
0 on success, otherwise a negative error value.
Return values:
MMI_ERROR_NONESuccessful
MMI_ERROR_NOT_SUPPORTEDNot supported
MMI_ERROR_INVALID_PARAMETERInvalid parameter
MMI_ERROR_OUT_OF_MEMORYOut of memory
See also:
mmi_workflow_h
mmi_port_h

Sets the type of a workflow prototype.

This function assigns a standard workflow type to the given workflow prototype.

Since :
9.0
Parameters:
[in]workflowThe handle of the workflow prototype.
[in]typeThe standard workflow type to be set.
Returns:
0 on success, otherwise a negative error value.
Return values:
MMI_ERROR_NONESuccessful
MMI_ERROR_NOT_SUPPORTEDNot supported
MMI_ERROR_INVALID_PARAMETERInvalid parameter
See also:
mmi_standard_workflow_type_e
mmi_workflow_get_type()
int mmi_workflow_signal_assign ( mmi_workflow_h  workflow,
const char *  signal_name,
const char *  target_node_name,
const char *  target_signal_name 
)

Assigns a signal of a workflow to a signal of a specific node in a workflow prototype.

This function assigns a signal from a workflow to a target signal of a specific node in the workflow prototype.

Since :
9.0
Parameters:
[in]workflowThe handle to the workflow.
[in]signal_nameThe name of the signal to assign.
[in]target_node_nameThe name of the target node where the signal will be assigned.
[in]target_signal_nameThe name of the target signal in the target node.
Returns:
0 on success, otherwise a negative error value.
Return values:
MMI_ERROR_NONESuccessful
MMI_ERROR_NOT_SUPPORTEDNot supported
MMI_ERROR_INVALID_PARAMETERInvalid parameter
MMI_ERROR_OUT_OF_MEMORYOut of memory
See also:
mmi_workflow_h