User Tools


Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
en:adminmanual:businessmappings:flowcontrol [2019/05/17 16:03]
joebordes [Versioning Quotes on Potentials Sales Stage]
— (current)
Line 1: Line 1:
-====== Flow Control Business Map ====== 
- 
-The purpose of this mapping is to define the flow of states that a field can go through, with the conditions that permit moving from one state to another and the actions to take, both in the case of permitting the change of state or not. Additionally,​ it will permit us to version related records when moving from one state to another. 
- 
-The accepted format is: 
-<code xml> 
- <​map>​ 
-  <​module>​ModuleName</​module>​ 
-  <​statefield>​fieldname</​statefield>​ 
-  <​launchconditions> ​ <!-- Evaluated on Save --> 
-    <​condition>​ 
-      <​expression></​expression>​ 
-    </​condition>​ 
-    <​condition>​ 
-      <​mapid></​mapid>​ 
-    </​condition>​ 
-  </​launchconditions>​ 
-  <​movements>​ 
-    <​movement>​ 
-      <​from></​from> ​ <!-- supports ANYFLOWCONTROLSTATE --> 
-      <​to></​to> ​ <!-- supports ANYFLOWCONTROLSTATE --> 
-      <​conditions>​ 
-        <​condition>​ 
-          <​expression></​expression>​ 
-        </​condition>​ 
-        <​condition>​ 
-         <​mapid></​mapid>​ 
-        </​condition>​ 
-      </​conditions>​ 
-      <​actionsyes>​ 
-       <​actions>​ 
-         <​workflow></​workflow> ​ <!-- repeat --> 
-         <​businessaction></​businessaction> ​ <!-- repeat --> 
-       </​actions>​ 
-      <​actionsyes>​ 
-      <​actionsno>​ 
-       <​actions>​ 
-         <​workflow></​workflow> ​ <!-- repeat --> 
-         <​businessaction></​businessaction> ​ <!-- repeat --> 
-       </​actions>​ 
-      <​actionsno>​ 
-      <​approvers>​ 
-        <​approver></​approver> ​ <!-- repeat --> 
-      </​approvers>​ 
-      <​coloryes></​coloryes>​ 
-      <​colorno></​colorno>​ 
-    </​movement>​ 
-  <​movements>​ 
-  <​version>​ 
-   <​module></​module> ​ <!-- repeat --> 
-  </​version>​ 
- </​map>​ 
-</​code>​ 
- 
-Let's see some examples of this map in action. 
- 
-====== Potentials Sales Stage ====== 
- 
-This map acts simply as a validation map that enforces the accepted **"​TO"​** states and the correct flow of states. In this case, ONLY the TO and FROM state values will be accepted in the record and it will only be permitted to move from-to the indicated steps. Since there are no pre-conditions,​ this map will be enforced on ALL potential records for ALL users. 
- 
-<code xml> 
- <​map>​ 
-  <​module>​Potentials</​module>​ 
-  <​statefield>​sales_stage</​statefield>​ 
-  <​movements>​ 
-    <​movement>​ 
-      <​from>​Prospecting</​from>​ 
-      <​to>​Needs Analysis</​to>​ 
-    </​movement>​ 
-    <​movement>​ 
-      <​from>​Needs Analysis</​from>​ 
-      <​to>​Proposal/​Price Quote</​to>​ 
-    </​movement>​ 
-    <​movement>​ 
-      <​from>​Proposal/​Price Quote</​from>​ 
-      <​to>​Closed Won</​to>​ 
-    </​movement>​ 
-    <​movement>​ 
-      <​from>​Proposal/​Price Quote</​from>​ 
-      <​to>​Closed Lost</​to>​ 
-    </​movement>​ 
-  <​movements>​ 
- </​map>​ 
-</​code>​ 
- 
-A variation on the map above is to apply the restrictions only on those records of type "Cross Sales"​. 
- 
-<code xml> 
- <​map>​ 
-  <​module>​Potentials</​module>​ 
-  <​statefield>​sales_stage</​statefield>​ 
-  <​launchconditions> ​ <!-- Evaluated on Save --> 
-    <​condition>​ 
-      <​expression>​if opportunity_type == 'Cross Sales' then 1 else 0 end</​expression>​ 
-    </​condition>​ 
-  </​launchconditions>​ 
-  <​movements>​ 
-    <​movement>​ 
-      <​from>​Prospecting</​from>​ 
-      <​to>​Needs Analysis</​to>​ 
-    </​movement>​ 
-    <​movement>​ 
-      <​from>​Needs Analysis</​from>​ 
-      <​to>​Proposal/​Price Quote</​to>​ 
-    </​movement>​ 
-    <​movement>​ 
-      <​from>​Proposal/​Price Quote</​from>​ 
-      <​to>​Closed Won</​to>​ 
-    </​movement>​ 
-    <​movement>​ 
-      <​from>​Proposal/​Price Quote</​from>​ 
-      <​to>​Closed Lost</​to>​ 
-    </​movement>​ 
-  <​movements>​ 
- </​map>​ 
-</​code>​ 
- 
- 
-Another variation on the map above is to permit going to the "Needs Analysis"​ stage only if the amount is bigger than 1000, if it is lower it must "​jump"​ over the analysis phase. Note how, in this case, we have two from-to definitions for "​Prospecting"​ in order to permit going to two different states. 
- 
-<code xml> 
- <​map>​ 
-  <​module>​Potentials</​module>​ 
-  <​statefield>​sales_stage</​statefield>​ 
-  <​launchconditions> ​ <!-- Evaluated on Save --> 
-    <​condition>​ 
-      <​expression>​if opportunity_type == 'Cross Sales' then 1 else 0 end</​expression>​ 
-    </​condition>​ 
-  </​launchconditions>​ 
-  <​movements>​ 
-    <​movement>​ 
-      <​from>​Prospecting</​from>​ 
-      <​to>​Needs Analysis</​to>​ 
-      <​conditions>​ 
-        <​condition>​ 
-          <​expression>​if amount > 1000 then 1 else 0 end</​expression>​ 
-        </​condition>​ 
-      </​conditions>​ 
-    </​movement>​ 
-      <​from>​Prospecting</​from>​ 
-      <​to>​Proposal/​Price Quote</​to>​ 
-    </​movement>​ 
-    <​movement>​ 
-      <​from>​Needs Analysis</​from>​ 
-      <​to>​Proposal/​Price Quote</​to>​ 
-    </​movement>​ 
-    <​movement>​ 
-      <​from>​Proposal/​Price Quote</​from>​ 
-      <​to>​Closed Won</​to>​ 
-    </​movement>​ 
-    <​movement>​ 
-      <​from>​Proposal/​Price Quote</​from>​ 
-      <​to>​Closed Lost</​to>​ 
-    </​movement>​ 
-  <​movements>​ 
- </​map>​ 
-</​code>​ 
- 
-====== Quotes Sales Approval ====== 
- 
-====== Versioning Quotes on Potentials Sales Stage ====== 
- 
-The flow control business map is a very powerful and versatile map. It not only permits us to establish a validation step process but it will also permit us to create versions of related records. 
- 
-coreBOS supports versioning of records natively so we must first configure this function correctly for the module we want to version. Then we will be able to add to the module to the flow control map and it will automatically launch the process for us when the flow state changes. 
- 
-<WRAP center round info 75%> 
-Note that in reality, this is just a helper syntax to adding the version action in the "​actionyes"​ section. 
-</​WRAP>​ 
- 
-The next map will version the quotes related to an opportunity on any sales stage change. 
- 
-<code XML> 
-<map> 
-  <​module>​Potentials</​module>​ 
-  <​statefield>​sales_stage</​statefield>​ 
-  <​movements>​ 
-    <​movement>​ 
-      <​from>​ANYFLOWCONTROLSTATE</​from>​ 
-      <​to>​ANYFLOWCONTROLSTATE</​to>​ 
-    </​movement>​ 
-  <​movements>​ 
-  <​version>​ 
-    <​module>​Quotes</​module>​ 
-  </​version>​ 
- </​map>​ 
-</​code>​ 
-====== Fundamental Logic of the map ====== 
- 
-  * it acts as a validation map enforcing the valid/​accepted states for the flow control field: if a value is not defined in the map it will not be accepted as a valid value when saving 
-  * it acts as a validation rule enforcing what values you can land on depending on the current value. You will only be able to set destination values that are defined in the map. This effectively constructs a directed graph of values. 
-  *