Model Object Workflow

This section provides information about functions, conditions, and variable resolvers for the model object workflow, as well as initial actions and reserved actions.

By default:

  • Only a Business Admin for the business, or a Schema Designer, can create or modify a model object.
  • When a new model object is created, or an existing model object is modified, the status of the object is Draft.
  • A model object can only be edited if it's in Draft state; before it's submitted for approval, or if it's rejected. When a model object is in Pending Approval or Active state, it cannot be edited.
  • A Business Admin for the business, or a Schema Designer, can submit a model object for approval. At that point, the status of the object is updated from Draft to Pending Approval.
  • A Business Admin or a Schema Approver can approve or reject a model object. If it's approved, it goes to Active state; if it's rejected, it goes back to Draft state.
  • A Business Admin or a Schema Designer can delete a model object.

For a workflow diagram, see What is the default workflow for models? (Community Manager developer portal help).

Table of Contents

Model Object Workflow: Initial Actions

The following initial actions are defined for model object workflows:

@Create

Starts the workflow, for a new model object.

For more information, see Workflow Initial Actions.

Model Object Workflow: Reserved Actions

The following reserved actions are defined for model object workflows:

@modify

Used to control workflow actions that occur when a model object is modified.

@delete

Used to control workflow actions that occur when a model object is deleted.

Note: If a model object is referenced by other model objects, it cannot be deleted.

Model Object Workflow: Actions

The following additional actions are defined for model object workflows:

model.action.submit.approval

Used to submit a new or revised model object for approval.

The Business Admin for the organization can submit a model object for approval.

For an example of a workflow section that includes this action, see isModelInDraftState.

model.action.resubmit

Used to resubmit a new or revised model object for approval.

Same as model.action.submit.approval above.

model.action.approve

Used to approve a new or revised model object that was submitted for approval.

The Business Admin for the organization, or the Schema Approver, can approve or reject a model object.

For an example of a workflow section that includes this action, see updateModelStatus.

model.action.reject

Used to reject a new or revised model object that was submitted for approval.

The Business Admin for the organization, or the Schema Approver, can approve or reject a model object.

Model Object Workflow: Functions

There is one function available for the model object workflow:

markModelDeleted

Marks a model object as deleted.

Note: If a model object is referenced by other model objects, it cannot be deleted.

Parameters

None.

Examples/Notes/Additional Information

The example below shows the Delete action in the default Model Object workflow. Once the conditions have been satisfied, the status is updated from Draft to Deleted and markModelDeleted is implemented as a post-function (line 17).

01 <action id="102" name="@Delete">
02   <restrict-to>
03     <conditions type="OR">
04       <condition type="authorizeByAtmosphereRole">
05         <arg name="role">&AtmoRoleBusinessAdmin;</arg>
06       </condition>
07       <condition type="authorizeByAtmosphereAction">
08         <arg name="Action">Delete</arg>
09         <arg name="ResourceType">modelversion</arg>
10       </condition> 
11     </conditions>
12   </restrict-to>
13   <results>
14     <unconditional-result old-status="Draft" status="Deleted" step="500" />
15   </results>
16   <post-functions>
17     <function type="markModelDeleted"/>
18   </post-functions>
19 </action>

updateModelStatus

Changes the state of a model object; for example, from Pending Approval to Active.

Parameters

Name Description/Values
status

The new state that the model object is being updated to. Valid values:

  • com.akana.model.state.draft
  • com.akana.model.state.pending_approval
  • com.akana.model.state.rejected
  • com.akana.model.state.active
  • com.akana.model.state.deleted

Examples/Notes/Additional Information

The example below shows the Approve action in the default Model Object workflow. Once the conditions have been satisfied, the status is updated from Pending Approval to Active and updateModelStatus is implemented as a post-function (line 16).

01 <action id="301" name="model.action.approve">
02   <restrict-to>
03     <conditions type="OR">
04       <condition type="authorizeByAtmosphereRole">
05         <arg name="role">&AtmoRoleBusinessAdmin;</arg>
06       </condition>
07       <condition type="authorizeByAtmosphereRole">
08         <arg name="role">&AtmoRoleSchemaApprover;</arg>
09       </condition> 
10     </conditions>
11   </restrict-to>
12   <results>
13     <unconditional-result old-status="Pending Approval" status="Active" step="400"/>
14   </results>
15   <post-functions>
16     <function type="updateModelStatus">
17       <arg name="status">&ModelStateActive;</arg>
18     </function>
19   </post-functions>
20 </action>

Model Object Workflow: Conditions

The following conditions apply to the comments workflow:

isModelInDraftState

Tests to see if the model object is in a Draft state; returns Boolean true or false.

Arguments

None.

Examples/Notes/Additional Information

In the example below, before the model object is submitted for approval, the workflow uses isModelInDraftState to make sure that the workflow is in Draft state (line 03). Only a workflow in Draft state can be submitted for approval.

01 <action id="103" name="model.action.submit.approval">
01   <restrict-to>
02     <conditions type="AND">
03       <condition type="isModelInDraftState" />
04       <conditions type="OR">
05         <condition type="authorizeByAtmosphereRole">
06           <arg name="role">&AtmoRoleBusinessAdmin;</arg>
07         </condition>
08         <condition type="authorizeByAtmosphereAction">
09           <arg name="Action">Modify</arg>
10           <arg name="ResourceType">modelversion</arg>
11         </condition> 
12       </conditions>
13     </conditions>

Note: This section of the default Model Object workflow also uses the general workflow conditions, authorizeByAtmosphereRole and authorizeByAtmosphereAction, to verify that the user initiating the action is a Business Admin (authorizeByAtmosphereRole) or other user who has permission to modify model objects, per the access control list (generally, Schema Designer).

Model Object Workflow: Variable Resolvers

There are no variables for the model object workflow.