Lightning Process Builder
&
Apex FlexQueue
Ahmedabad - June 20th, 2016
Agenda
• Process Builder
• Demo of Process Builder
• Invocable Methods Demo & Best Practices
• Apex FlexQueue
• Questions
Process Builder
What is it and how does it help
What is Process Builder?
• Introduced as part of the Lightning Framework “a point and click tool for
automating business processes” sits under Workflow & Approvals.
– Similar to Workflow…
• Processes driven by users manipulation of Records
• Workflow Actions Email Alerts, Approval, Field Updates
– But much more…
• Actions can be Immediate or Scheduled
• New Actions, Manage Child Records, Post to Chatter,
Call Flow, Call Apex
What is Process Builder?
Next Generation Workflow New Actions
Workflow Rules
Multiple “Rules” in 1 process
More Flexibility
Graphical Interface
Process without Programming
• Built for all Admins - from
beginners to advanced
• Easy edit lets users respond
quickly to business changes
• Creates a shared canvas for IT
and the Business to collaborate
Add powerful
actions with a
single click
Process Builder Demo
Process Builder Use Case
• Create related Child Records
– “Create a Contact when an Opportunity is Closed”
• Update records
– “Keep Contacts address in sync from Account”
• Post to Chatter
– “Update Opportunity won on Chatter”
Invocable Methods
Introduction & Code Examples
What are Invocable Methods?
• When standard Process Builder Actions are just not enough, do I
have to stop using Process Builder?
• A means to extend Process Builder with Apex! *
– Have developers think about exposing ‘actions’
– Consider packaging actions for greater reuse
* It is also possible to extend the Salesforce Visual Flow tool in the same way.
Invocable Methods can also be called Salesforce REST API, e.g. mobile clients
Invocable Method Example A
NOTE: None void return types from
Invocable Methods are supported,
but are not of interest to Process
Builder.
Invocable Method Example B
NOTE: Note use of label and required variables enhance the
Process Builder UI for the end user
Invocable Methods
Demo
Invocable Methods
Best Practices
Invocable Methods Best Practices *
• Single Invocable method per apex class.
• Not available via Triggers
• Must be static & public/global
• Parameter/ReturnType with data-type :
 Primitive data type or a list of primitive data type
 List of sObject type – generic sObject not supported.
 List of user-defined type
• Once added in package, can’t remove from later versions.
• Make use of label, description and required annotation
attributes to make your methods more accessible to end users of Process
Builder
Process Builder Hot Topics
• What are the limitations on deleting a process ?
• How Can I move processes from one org to another ?
• Formula Limitations ?
• How do I know which automation tool to use ?
• Can I create Task with Process Builder ?
Resources
• Community Blogs featuring Process Builder and Incovable Methods
– Lightning Process Builder and Invocable Methods
http://bobbuzzard.blogspot.co.uk/2015/02/lightning-process-builder-and-invocable.html
– Extending Lightning Process Builder and Visual Workflow with Apex
http://andyinthecloud.com/2015/03/01/extending-lightning-process-builder-and-visual-workflow-with-apex/
– The Revolution !! Invocable Power - Spring 15
http://andyinthecloud.com/category/process-builder/
– Controlling Internet Devices via Lightning Process Builder
http://andyinthecloud.com/2015/01/31/controlling-internet-devices-via-lightning-process-builder/
– Process Builder Workflow Automation Group
https://success.salesforce.com/_ui/core/chatter/groups/GroupProfilePage?g=0F9300000001rzc
• General Gotchas
– Process Builder Bulkification issue with field expressions
http://www.tquila.com/blog/2015/03/09/bulkify-lightning-process-builder
– Salesforce Process Builder Known Issues
https://success.salesforce.com/issues_index?tag=Process%20Builder
Recap
• Go Faster with Process Builder!
– Reduce Implementation Time
• Many use cases previously only possible with Apex Triggers now possible
with clicks not code via Process Builder
– Developers and Admins Working Closer Together to automate more!
• Think about ways to extend Process Builder via Invocable Actions
– Opportunities to create Libraries of Invocable Methods to share
• Invocable Methods can be packaged
Apex FlexQueue
Before :

Which
Options Do
We have ?
@future
@Batch
Jobs
Schedule
Jobs
Limitations of Asynchronous Process
Waits for salesforce
resources
No Job Id
Only Return Void
Parameters must be
primitive
@future
Can’t order jobs
Only 5 active jobs
Batch
And Now :
Flex Queue
Flex Queue Add-On
More than 5 apex jobs in Apex Jobs Table
5 Jobs Processing + 95 Jobs holding
New UI to monitor & manage Jobs
Reorder the holding apex Jobs
Apex FlexQueue
Demo
Thank you

Ahmedabad Salesforce Meetup

  • 1.
    Lightning Process Builder & ApexFlexQueue Ahmedabad - June 20th, 2016
  • 2.
    Agenda • Process Builder •Demo of Process Builder • Invocable Methods Demo & Best Practices • Apex FlexQueue • Questions
  • 3.
    Process Builder What isit and how does it help
  • 4.
    What is ProcessBuilder? • Introduced as part of the Lightning Framework “a point and click tool for automating business processes” sits under Workflow & Approvals. – Similar to Workflow… • Processes driven by users manipulation of Records • Workflow Actions Email Alerts, Approval, Field Updates – But much more… • Actions can be Immediate or Scheduled • New Actions, Manage Child Records, Post to Chatter, Call Flow, Call Apex
  • 5.
    What is ProcessBuilder? Next Generation Workflow New Actions Workflow Rules Multiple “Rules” in 1 process More Flexibility Graphical Interface
  • 6.
    Process without Programming •Built for all Admins - from beginners to advanced • Easy edit lets users respond quickly to business changes • Creates a shared canvas for IT and the Business to collaborate Add powerful actions with a single click
  • 7.
  • 8.
    Process Builder UseCase • Create related Child Records – “Create a Contact when an Opportunity is Closed” • Update records – “Keep Contacts address in sync from Account” • Post to Chatter – “Update Opportunity won on Chatter”
  • 9.
  • 10.
    What are InvocableMethods? • When standard Process Builder Actions are just not enough, do I have to stop using Process Builder? • A means to extend Process Builder with Apex! * – Have developers think about exposing ‘actions’ – Consider packaging actions for greater reuse * It is also possible to extend the Salesforce Visual Flow tool in the same way. Invocable Methods can also be called Salesforce REST API, e.g. mobile clients
  • 11.
    Invocable Method ExampleA NOTE: None void return types from Invocable Methods are supported, but are not of interest to Process Builder.
  • 12.
    Invocable Method ExampleB NOTE: Note use of label and required variables enhance the Process Builder UI for the end user
  • 13.
  • 14.
  • 15.
    Invocable Methods BestPractices * • Single Invocable method per apex class. • Not available via Triggers • Must be static & public/global • Parameter/ReturnType with data-type :  Primitive data type or a list of primitive data type  List of sObject type – generic sObject not supported.  List of user-defined type • Once added in package, can’t remove from later versions. • Make use of label, description and required annotation attributes to make your methods more accessible to end users of Process Builder
  • 16.
    Process Builder HotTopics • What are the limitations on deleting a process ? • How Can I move processes from one org to another ? • Formula Limitations ? • How do I know which automation tool to use ? • Can I create Task with Process Builder ?
  • 17.
    Resources • Community Blogsfeaturing Process Builder and Incovable Methods – Lightning Process Builder and Invocable Methods http://bobbuzzard.blogspot.co.uk/2015/02/lightning-process-builder-and-invocable.html – Extending Lightning Process Builder and Visual Workflow with Apex http://andyinthecloud.com/2015/03/01/extending-lightning-process-builder-and-visual-workflow-with-apex/ – The Revolution !! Invocable Power - Spring 15 http://andyinthecloud.com/category/process-builder/ – Controlling Internet Devices via Lightning Process Builder http://andyinthecloud.com/2015/01/31/controlling-internet-devices-via-lightning-process-builder/ – Process Builder Workflow Automation Group https://success.salesforce.com/_ui/core/chatter/groups/GroupProfilePage?g=0F9300000001rzc • General Gotchas – Process Builder Bulkification issue with field expressions http://www.tquila.com/blog/2015/03/09/bulkify-lightning-process-builder – Salesforce Process Builder Known Issues https://success.salesforce.com/issues_index?tag=Process%20Builder
  • 18.
    Recap • Go Fasterwith Process Builder! – Reduce Implementation Time • Many use cases previously only possible with Apex Triggers now possible with clicks not code via Process Builder – Developers and Admins Working Closer Together to automate more! • Think about ways to extend Process Builder via Invocable Actions – Opportunities to create Libraries of Invocable Methods to share • Invocable Methods can be packaged
  • 19.
  • 20.
    Before : Which Options Do Wehave ? @future @Batch Jobs Schedule Jobs
  • 21.
    Limitations of AsynchronousProcess Waits for salesforce resources No Job Id Only Return Void Parameters must be primitive @future Can’t order jobs Only 5 active jobs Batch
  • 22.
  • 23.
    Flex Queue Add-On Morethan 5 apex jobs in Apex Jobs Table 5 Jobs Processing + 95 Jobs holding New UI to monitor & manage Jobs Reorder the holding apex Jobs
  • 24.
  • 26.

Editor's Notes