Map your flows (Optional)¶
This flow decider is part of the Lime Generate package
How it works¶
In Lime admin you can set up a limetype and property that should decide which automated flow an object should go to.
It will set a relation to the automated flow on the object using a decorator on the custom limeobject.
Custom Limeobject needed
For this to work you'll need to add a custom limeobject and set the decorator from the sdk module.
Which then later or directly can be used for creating the actual AF participant.
Setup mapping in Lime CRM admin¶
Go to Administration page -> Settings -> Automated Flows -> Flow decider
and add a new item.
Here you will select a limetype and property to use for the mapping.
Warning
Only limetypes that have a relation to Automated flow and have the decider decorator in a custom limeobject will be selectable
Only properties that are single relations or options will be selectable
Setup custom limeobject with decorator¶
For the add-on to set the relation you'll need to have a custom limeobject for the limetype(s) you have selected in the previous step.
Here's an example of how it could look on the lead
limetype with no other customizations
from lime_type.limeobjects import LimeObject
import addon_lime_automation.sdk.decorators as automation_decorators
@automation_decorators.automated_flow_decider()
class Lead(LimeObject):
def before_update(self, uow, **kwargs):
super().before_update(uow, **kwargs)
def after_update(self, **kwargs):
super().after_update(**kwargs)
def register_limeobject_classes(register_class):
register_class("lead", Lead)
For more ways and tips on how to use and adapt this to your solution, check out the information here