SlideShare ist ein Scribd-Unternehmen logo
1 von 27
Apex Liberation 
Carolina Ruiz Medina 
Principal Developer in Product Innovation Team at FinancialForce.com 
@CarolEnLaNube
Safe Harbor 
Safe harbor statement under the Private Securities Litigation Reform Act of 1995: 
This presentation may contain forward-looking statements that involve risks, uncertainties, and assumptions. If any such uncertainties materialize or if any of 
the assumptions proves incorrect, the results of salesforce.com, inc. could differ materially from the results expressed or implied by the forward-looking 
statements we make. All statements other than statements of historical fact could be deemed forward-looking, including any projections of product or service 
availability, subscriber growth, earnings, revenues, or other financial items and any statements regarding strategies or plans of management for future 
operations, statements of belief, any statements concerning new, planned, or upgraded services or technology developments and customer contracts or use of 
our services. 
The risks and uncertainties referred to above include – but are not limited to – risks associated with developing and delivering new functionality for our service, 
new products and services, our new business model, our past operating losses, possible fluctuations in our operating results and rate of growth, interruptions or 
delays in our Web hosting, breach of our security measures, the outcome of any litigation, risks associated with completed and any possible mergers and 
acquisitions, the immature market in which we operate, our relatively limited operating history, our ability to expand, retain, and motivate our employees and 
manage our growth, new releases of our service and successful customer deployment, our limited history reselling non-salesforce.com products, and utilization 
and selling to larger enterprise customers. Further information on potential factors that could affect the financial results of salesforce.com, inc. is included in our 
annual report on Form 10-K for the most recent fiscal year and in our quarterly report on Form 10-Q for the most recent fiscal quarter. These documents and 
others containing important disclosures are available on the SEC Filings section of the Investor Information section of our Web site. 
Any unreleased services or features referenced in this or other presentations, press releases or public statements are not currently available and may not be 
delivered on time or at all. Customers who purchase our services should make the purchase decisions based upon features that are currently available. 
Salesforce.com, inc. assumes no obligation and does not intend to update these forward-looking statements.
Carolina Ruiz Medina 
Principal Developer in Product Innovation 
Team
About FinancialForce.com 
• San Francisco Headquarters 
• Harrogate, UK 
• Granada, Spain 
• Toronto, Canada 
• Manchester, US 
• Opening Sydney, AUS in Sept, 2014 
• 350+ Employees 
• 400+ by 12/31/2014 
• Customers in 31 countries 
• 80% Y-o-Y revenue growth 
• Advent commitment of $50 million
Before 
Asynchronous to process large amount of data 
• @Future 
• Batch Jobs 
• Schedule Jobs 
• Which 
options do 
we have? 
What is it?
Before 
• The methods execute when 
Salesforce has available 
resources 
• @future only 
returns void type 
• No job ID for @future jobs 
• Parameters must be @Future 
primitive data types 
We can’t monitor 
the future jobs 
• Future methods must 
be static methods 
• The method does not 
necessarily execute in 
the same order is 
called
Before 
public with sharing class FutureClass { 
@future 
static void myMethod(String a, Integer i) { 
System.debug('Method called with: ' + a + ' and ' + i+'... and I loved the sunny days :)'); 
// Perform long-running code 
} 
}
Before: 
Batch Jobs 
Before 
• Database.executeBatch 
returns Id 
• We can monitor the batch jobs 
• We can’t order 
batch jobs 
• Only 5 active jobs are 
allow in the queue at the 
same time ( //show error ) 
• Interfaces that we can 
override in order to 
process data 
• Recursive calls 
• Possibility to use iterator 
– process different objet 
type in the same batch
BBeefofroer: e 
public class UpdateAccountFields implements Database.Batchable<sObject>{ 
public final String Query; public final String Entity; 
public final String Field; public final String Value; 
public UpdateAccountFields(String q, String e, String f, String v){ 
Query=q; Entity=e; Field=f;Value=v; 
} 
public Database.QueryLocator start(Database.BatchableContext BC){ 
return Database.getQueryLocator(query); 
} 
public void execute(Database.BatchableContext BC, 
List<sObject> scope){ 
for(Sobject s : scope){s.put(Field,Value); 
} update scope; 
} 
public void finish(Database.BatchableContext BC){ 
} 
}
and Now.. 
@Future F l e x Q u e u e Batch
and Now.. 
Asynchronous 
• @Future 
• Batch Jobs : With FlexQue 
• Schedule Jobs 
• Queueable Interface
Flex Queue 
More than 5 Apex Jobs 
More than 5 Apex Jobs in the Apex Jobs Table 
5 Apex Jobs Processing + 95 Apex Jobs Holding 
New UI to monitor and manage the Apex Jobs in Holding Status 
Reorder the holding Apex Jobs 
Now
Flex Queue 
More than 5 Apex Jobs 
More than 5 Apex Jobs in the Apex Jobs Table 
Now 
Show me!
Flex Queue 
More than 5 Apex Jobs 
More than 5 Apex Jobs in the Apex Jobs Table 
5 Apex Jobs Processing + 95 Apex Jobs Holding 
Now 
I don’t believe you, show that!
Flex Queue 
More than 5 Apex Jobs 
More than 5 Apex Jobs in the Apex Jobs Table 
5 Apex Jobs Processing + 95 Apex Jobs Holding 
New UI to monitor and manage the Apex Jobs in Holding Status 
Now 
Where is it? How does it work?!
Flex Queue 
More than 5 Apex Jobs 
More than 5 Apex Jobs in the Apex Jobs Table 
5 Apex Jobs Processing + 95 Apex Jobs Holding 
New UI to monitor and manage the Apex Jobs in Holding Status 
Reorder the holding Apex Jobs 
Now 
Lets reorder then!
Flex Queue 
Then 
Maybe you are thinking now… 
• Schedule Jobs: do they work in the same way? 
Yes, everything continues exactly the same. The benefit is now we can 
schedule and run jobs that call apex jobs having the benefit of Flex Queue 
that allow us to set the Batch in Holding status 
• Can I reorder using any apex Method? 
• Can I abort the Holding Jobs by UI or using System.Abort?
Demo 
Aborting Jobs
Taking 
Care!! 
With a big power became a big responsibility 
• Only re order when necessary 
• If there are batch jobs that are dependent to others! 
• If there are chaining batch jobs
Extra 
public class AsyncExecutionExample implements Queueable { 
public void execute(QueueableContext context) { 
Account a = new Account(Name='Acme',Phone='(415) 555-1212'); 
insert a; 
} 
} 
Submit and Monitor Jobs for Asynchronous 
Execution with the Queueable Interface 
ID jobID = System.enqueueJob(new AsyncExecutionExample()); 
AsyncApexJob jobInfo = [SELECT Status,NumberOfErrors FROM AsyncApexJob WHERE 
Id=:jobID];
Demo 
Queueauble interface
Links 
• Josh Kaplan blog 
• Apex Developer guide 
• Winter ‘15 release notes
Q&A 
as I always say… Easy questions please ☺ 
@CarolEnLaNube
Apex Flex Queue: Batch Apex Liberated

Weitere ähnliche Inhalte

Was ist angesagt?

Leveraging JavaScript Promises and the Bulk API
Leveraging JavaScript Promises and the Bulk APILeveraging JavaScript Promises and the Bulk API
Leveraging JavaScript Promises and the Bulk APISalesforce Developers
 
Client-Side Performance Testing
Client-Side Performance TestingClient-Side Performance Testing
Client-Side Performance TestingAnand Bagmar
 
Apex Testing and Best Practices
Apex Testing and Best PracticesApex Testing and Best Practices
Apex Testing and Best PracticesJitendra Zaa
 
Apex 10 commandments df14
Apex 10 commandments df14Apex 10 commandments df14
Apex 10 commandments df14James Loghry
 
WSO2 Test Automation Framework : Approach and Adoption
WSO2 Test Automation Framework : Approach and AdoptionWSO2 Test Automation Framework : Approach and Adoption
WSO2 Test Automation Framework : Approach and AdoptionWSO2
 
PHPUnit with CakePHP and Yii
PHPUnit with CakePHP and YiiPHPUnit with CakePHP and Yii
PHPUnit with CakePHP and Yiimadhavi Ghadge
 
Magento's Imagine eCommerce Conference: Do You Queue?
Magento's Imagine eCommerce Conference: Do You Queue?Magento's Imagine eCommerce Conference: Do You Queue?
Magento's Imagine eCommerce Conference: Do You Queue?varien
 
Episode 1 - PathToCode.com
Episode 1 - PathToCode.comEpisode 1 - PathToCode.com
Episode 1 - PathToCode.comJitendra Zaa
 
How to Run a 1,000,000 VU Load Test using Apache JMeter and BlazeMeter
How to Run a 1,000,000 VU Load Test using Apache JMeter and BlazeMeterHow to Run a 1,000,000 VU Load Test using Apache JMeter and BlazeMeter
How to Run a 1,000,000 VU Load Test using Apache JMeter and BlazeMeterAlon Girmonsky
 
Behaviour driven development
Behaviour driven developmentBehaviour driven development
Behaviour driven developmentHarry Potter
 
Testing Without Waste - Automatic Testing
Testing Without Waste - Automatic TestingTesting Without Waste - Automatic Testing
Testing Without Waste - Automatic TestingFuturice
 

Was ist angesagt? (15)

Leveraging JavaScript Promises and the Bulk API
Leveraging JavaScript Promises and the Bulk APILeveraging JavaScript Promises and the Bulk API
Leveraging JavaScript Promises and the Bulk API
 
Client-Side Performance Testing
Client-Side Performance TestingClient-Side Performance Testing
Client-Side Performance Testing
 
10 Principles of Apex Testing
10 Principles of Apex Testing10 Principles of Apex Testing
10 Principles of Apex Testing
 
Apex Testing and Best Practices
Apex Testing and Best PracticesApex Testing and Best Practices
Apex Testing and Best Practices
 
Apex 10 commandments df14
Apex 10 commandments df14Apex 10 commandments df14
Apex 10 commandments df14
 
WSO2 Test Automation Framework : Approach and Adoption
WSO2 Test Automation Framework : Approach and AdoptionWSO2 Test Automation Framework : Approach and Adoption
WSO2 Test Automation Framework : Approach and Adoption
 
PHPUnit with CakePHP and Yii
PHPUnit with CakePHP and YiiPHPUnit with CakePHP and Yii
PHPUnit with CakePHP and Yii
 
Magento's Imagine eCommerce Conference: Do You Queue?
Magento's Imagine eCommerce Conference: Do You Queue?Magento's Imagine eCommerce Conference: Do You Queue?
Magento's Imagine eCommerce Conference: Do You Queue?
 
Profilling client performance
Profilling client performanceProfilling client performance
Profilling client performance
 
Episode 1 - PathToCode.com
Episode 1 - PathToCode.comEpisode 1 - PathToCode.com
Episode 1 - PathToCode.com
 
Performance with Selenium2
Performance with Selenium2Performance with Selenium2
Performance with Selenium2
 
Karate DSL
Karate DSLKarate DSL
Karate DSL
 
How to Run a 1,000,000 VU Load Test using Apache JMeter and BlazeMeter
How to Run a 1,000,000 VU Load Test using Apache JMeter and BlazeMeterHow to Run a 1,000,000 VU Load Test using Apache JMeter and BlazeMeter
How to Run a 1,000,000 VU Load Test using Apache JMeter and BlazeMeter
 
Behaviour driven development
Behaviour driven developmentBehaviour driven development
Behaviour driven development
 
Testing Without Waste - Automatic Testing
Testing Without Waste - Automatic TestingTesting Without Waste - Automatic Testing
Testing Without Waste - Automatic Testing
 

Andere mochten auch

Advanced Apex Development - Asynchronous Processes
Advanced Apex Development - Asynchronous ProcessesAdvanced Apex Development - Asynchronous Processes
Advanced Apex Development - Asynchronous ProcessesSalesforce Developers
 
Salesforce Apex Ten Commandments
Salesforce Apex Ten CommandmentsSalesforce Apex Ten Commandments
Salesforce Apex Ten CommandmentsNetStronghold
 
Salesforce Meetup 18 April 2015 - Apex Trigger & Scheduler Framworks
Salesforce Meetup 18 April 2015 - Apex Trigger & Scheduler FramworksSalesforce Meetup 18 April 2015 - Apex Trigger & Scheduler Framworks
Salesforce Meetup 18 April 2015 - Apex Trigger & Scheduler FramworksSumitkumar Shingavi
 
Dive Deep into Apex: Advanced Apex!
Dive Deep into Apex: Advanced Apex! Dive Deep into Apex: Advanced Apex!
Dive Deep into Apex: Advanced Apex! Salesforce Developers
 
Asynchronous Apex Salesforce World Tour Paris 2015
Asynchronous Apex Salesforce World Tour Paris 2015Asynchronous Apex Salesforce World Tour Paris 2015
Asynchronous Apex Salesforce World Tour Paris 2015Samuel De Rycke
 
Salesforce Multitenant Architecture: How We Do the Magic We Do
Salesforce Multitenant Architecture: How We Do the Magic We DoSalesforce Multitenant Architecture: How We Do the Magic We Do
Salesforce Multitenant Architecture: How We Do the Magic We DoSalesforce Developers
 

Andere mochten auch (8)

Salesforce asynchronous apex
Salesforce asynchronous apexSalesforce asynchronous apex
Salesforce asynchronous apex
 
Advanced Apex Development - Asynchronous Processes
Advanced Apex Development - Asynchronous ProcessesAdvanced Apex Development - Asynchronous Processes
Advanced Apex Development - Asynchronous Processes
 
Salesforce Apex Ten Commandments
Salesforce Apex Ten CommandmentsSalesforce Apex Ten Commandments
Salesforce Apex Ten Commandments
 
Salesforce Meetup 18 April 2015 - Apex Trigger & Scheduler Framworks
Salesforce Meetup 18 April 2015 - Apex Trigger & Scheduler FramworksSalesforce Meetup 18 April 2015 - Apex Trigger & Scheduler Framworks
Salesforce Meetup 18 April 2015 - Apex Trigger & Scheduler Framworks
 
Apex Nirvana
Apex NirvanaApex Nirvana
Apex Nirvana
 
Dive Deep into Apex: Advanced Apex!
Dive Deep into Apex: Advanced Apex! Dive Deep into Apex: Advanced Apex!
Dive Deep into Apex: Advanced Apex!
 
Asynchronous Apex Salesforce World Tour Paris 2015
Asynchronous Apex Salesforce World Tour Paris 2015Asynchronous Apex Salesforce World Tour Paris 2015
Asynchronous Apex Salesforce World Tour Paris 2015
 
Salesforce Multitenant Architecture: How We Do the Magic We Do
Salesforce Multitenant Architecture: How We Do the Magic We DoSalesforce Multitenant Architecture: How We Do the Magic We Do
Salesforce Multitenant Architecture: How We Do the Magic We Do
 

Ähnlich wie Apex Flex Queue: Batch Apex Liberated

Apex Nuances: Transitioning to Force.com Development
Apex Nuances: Transitioning to Force.com DevelopmentApex Nuances: Transitioning to Force.com Development
Apex Nuances: Transitioning to Force.com DevelopmentSalesforce Developers
 
Quickly Create Data Sets for the Analytics Cloud
Quickly Create Data Sets for the Analytics CloudQuickly Create Data Sets for the Analytics Cloud
Quickly Create Data Sets for the Analytics CloudSalesforce Developers
 
Hands-On Workshop: Introduction to Coding for on Force.com for Admins and Non...
Hands-On Workshop: Introduction to Coding for on Force.com for Admins and Non...Hands-On Workshop: Introduction to Coding for on Force.com for Admins and Non...
Hands-On Workshop: Introduction to Coding for on Force.com for Admins and Non...Salesforce Developers
 
Design Patterns Every ISV Needs to Know (October 15, 2014)
Design Patterns Every ISV Needs to Know (October 15, 2014)Design Patterns Every ISV Needs to Know (October 15, 2014)
Design Patterns Every ISV Needs to Know (October 15, 2014)Salesforce Partners
 
Look Ma, No Apex: Mobile Apps with RemoteObject and Mobile SDK
Look Ma, No Apex: Mobile Apps with RemoteObject and Mobile SDKLook Ma, No Apex: Mobile Apps with RemoteObject and Mobile SDK
Look Ma, No Apex: Mobile Apps with RemoteObject and Mobile SDKSalesforce Developers
 
Apex Liberation - the evolution of Flex Queue (DF15)
Apex Liberation - the evolution of Flex Queue (DF15)Apex Liberation - the evolution of Flex Queue (DF15)
Apex Liberation - the evolution of Flex Queue (DF15)Stephen Willcock
 
Spring '14 Release Developer Preview Webinar
Spring '14 Release Developer Preview WebinarSpring '14 Release Developer Preview Webinar
Spring '14 Release Developer Preview WebinarSalesforce Developers
 
Looking under the hood of your org with eclipse
Looking under the hood of your org with eclipseLooking under the hood of your org with eclipse
Looking under the hood of your org with eclipseJamie Buck-Tomek
 
Getting Started With Apex REST Services
Getting Started With Apex REST ServicesGetting Started With Apex REST Services
Getting Started With Apex REST ServicesSalesforce Developers
 
Making External Web Pages Interact With Visualforce
Making External Web Pages Interact With VisualforceMaking External Web Pages Interact With Visualforce
Making External Web Pages Interact With VisualforceSalesforce Developers
 
Coding Apps in the Cloud with Force.com - Part 2
Coding Apps in the Cloud with Force.com - Part 2Coding Apps in the Cloud with Force.com - Part 2
Coding Apps in the Cloud with Force.com - Part 2Salesforce Developers
 
Get ready for your platform developer i certification webinar
Get ready for your platform developer i certification   webinarGet ready for your platform developer i certification   webinar
Get ready for your platform developer i certification webinarJackGuo20
 
Webinar Coding for Salesforce Admins
Webinar Coding for Salesforce AdminsWebinar Coding for Salesforce Admins
Webinar Coding for Salesforce AdminsSalesforce Admins
 
Building Command-line Tools with the Tooling API
Building Command-line Tools with the Tooling APIBuilding Command-line Tools with the Tooling API
Building Command-line Tools with the Tooling APIJeff Douglas
 
Spring '16 Release Overview - Bilbao Feb 2016
Spring '16 Release Overview - Bilbao Feb 2016Spring '16 Release Overview - Bilbao Feb 2016
Spring '16 Release Overview - Bilbao Feb 2016Peter Chittum
 
Force.com Friday: Intro to Force.com
Force.com Friday: Intro to Force.comForce.com Friday: Intro to Force.com
Force.com Friday: Intro to Force.comSalesforce Developers
 
Intro to Apex - Salesforce Force Friday Webinar
Intro to Apex - Salesforce Force Friday Webinar Intro to Apex - Salesforce Force Friday Webinar
Intro to Apex - Salesforce Force Friday Webinar Abhinav Gupta
 

Ähnlich wie Apex Flex Queue: Batch Apex Liberated (20)

Apex Nuances: Transitioning to Force.com Development
Apex Nuances: Transitioning to Force.com DevelopmentApex Nuances: Transitioning to Force.com Development
Apex Nuances: Transitioning to Force.com Development
 
Quickly Create Data Sets for the Analytics Cloud
Quickly Create Data Sets for the Analytics CloudQuickly Create Data Sets for the Analytics Cloud
Quickly Create Data Sets for the Analytics Cloud
 
Hands-On Workshop: Introduction to Coding for on Force.com for Admins and Non...
Hands-On Workshop: Introduction to Coding for on Force.com for Admins and Non...Hands-On Workshop: Introduction to Coding for on Force.com for Admins and Non...
Hands-On Workshop: Introduction to Coding for on Force.com for Admins and Non...
 
Design Patterns Every ISV Needs to Know (October 15, 2014)
Design Patterns Every ISV Needs to Know (October 15, 2014)Design Patterns Every ISV Needs to Know (October 15, 2014)
Design Patterns Every ISV Needs to Know (October 15, 2014)
 
Look Ma, No Apex: Mobile Apps with RemoteObject and Mobile SDK
Look Ma, No Apex: Mobile Apps with RemoteObject and Mobile SDKLook Ma, No Apex: Mobile Apps with RemoteObject and Mobile SDK
Look Ma, No Apex: Mobile Apps with RemoteObject and Mobile SDK
 
Spring '16 Release Preview Webinar
Spring '16 Release Preview Webinar Spring '16 Release Preview Webinar
Spring '16 Release Preview Webinar
 
Apex Liberation - the evolution of Flex Queue (DF15)
Apex Liberation - the evolution of Flex Queue (DF15)Apex Liberation - the evolution of Flex Queue (DF15)
Apex Liberation - the evolution of Flex Queue (DF15)
 
Introduction to Apex Triggers
Introduction to Apex TriggersIntroduction to Apex Triggers
Introduction to Apex Triggers
 
Spring '14 Release Developer Preview Webinar
Spring '14 Release Developer Preview WebinarSpring '14 Release Developer Preview Webinar
Spring '14 Release Developer Preview Webinar
 
Looking under the hood of your org with eclipse
Looking under the hood of your org with eclipseLooking under the hood of your org with eclipse
Looking under the hood of your org with eclipse
 
Getting Started With Apex REST Services
Getting Started With Apex REST ServicesGetting Started With Apex REST Services
Getting Started With Apex REST Services
 
Making External Web Pages Interact With Visualforce
Making External Web Pages Interact With VisualforceMaking External Web Pages Interact With Visualforce
Making External Web Pages Interact With Visualforce
 
Coding Apps in the Cloud with Force.com - Part 2
Coding Apps in the Cloud with Force.com - Part 2Coding Apps in the Cloud with Force.com - Part 2
Coding Apps in the Cloud with Force.com - Part 2
 
Get ready for your platform developer i certification webinar
Get ready for your platform developer i certification   webinarGet ready for your platform developer i certification   webinar
Get ready for your platform developer i certification webinar
 
Force.com Friday : Intro to Apex
Force.com Friday : Intro to Apex Force.com Friday : Intro to Apex
Force.com Friday : Intro to Apex
 
Webinar Coding for Salesforce Admins
Webinar Coding for Salesforce AdminsWebinar Coding for Salesforce Admins
Webinar Coding for Salesforce Admins
 
Building Command-line Tools with the Tooling API
Building Command-line Tools with the Tooling APIBuilding Command-line Tools with the Tooling API
Building Command-line Tools with the Tooling API
 
Spring '16 Release Overview - Bilbao Feb 2016
Spring '16 Release Overview - Bilbao Feb 2016Spring '16 Release Overview - Bilbao Feb 2016
Spring '16 Release Overview - Bilbao Feb 2016
 
Force.com Friday: Intro to Force.com
Force.com Friday: Intro to Force.comForce.com Friday: Intro to Force.com
Force.com Friday: Intro to Force.com
 
Intro to Apex - Salesforce Force Friday Webinar
Intro to Apex - Salesforce Force Friday Webinar Intro to Apex - Salesforce Force Friday Webinar
Intro to Apex - Salesforce Force Friday Webinar
 

Mehr von CarolEnLaNube

Data Pipelines -Big Data Meets Salesforce
Data Pipelines -Big Data Meets SalesforceData Pipelines -Big Data Meets Salesforce
Data Pipelines -Big Data Meets SalesforceCarolEnLaNube
 
Elevate Madrid Essentials - Advance Track
Elevate Madrid Essentials - Advance TrackElevate Madrid Essentials - Advance Track
Elevate Madrid Essentials - Advance TrackCarolEnLaNube
 
DF14 First Spanish Session - Building an app in Salesforce1
DF14 First Spanish Session - Building an app in Salesforce1DF14 First Spanish Session - Building an app in Salesforce1
DF14 First Spanish Session - Building an app in Salesforce1CarolEnLaNube
 
TicMind - Gamificación- SalesforceDevGroupMadrid- Primera Reunion
TicMind - Gamificación- SalesforceDevGroupMadrid- Primera ReunionTicMind - Gamificación- SalesforceDevGroupMadrid- Primera Reunion
TicMind - Gamificación- SalesforceDevGroupMadrid- Primera ReunionCarolEnLaNube
 
Descubre La Comunidad Salesforce
Descubre La Comunidad SalesforceDescubre La Comunidad Salesforce
Descubre La Comunidad SalesforceCarolEnLaNube
 
PCE-Salesforce1MobileApp
PCE-Salesforce1MobileAppPCE-Salesforce1MobileApp
PCE-Salesforce1MobileAppCarolEnLaNube
 

Mehr von CarolEnLaNube (6)

Data Pipelines -Big Data Meets Salesforce
Data Pipelines -Big Data Meets SalesforceData Pipelines -Big Data Meets Salesforce
Data Pipelines -Big Data Meets Salesforce
 
Elevate Madrid Essentials - Advance Track
Elevate Madrid Essentials - Advance TrackElevate Madrid Essentials - Advance Track
Elevate Madrid Essentials - Advance Track
 
DF14 First Spanish Session - Building an app in Salesforce1
DF14 First Spanish Session - Building an app in Salesforce1DF14 First Spanish Session - Building an app in Salesforce1
DF14 First Spanish Session - Building an app in Salesforce1
 
TicMind - Gamificación- SalesforceDevGroupMadrid- Primera Reunion
TicMind - Gamificación- SalesforceDevGroupMadrid- Primera ReunionTicMind - Gamificación- SalesforceDevGroupMadrid- Primera Reunion
TicMind - Gamificación- SalesforceDevGroupMadrid- Primera Reunion
 
Descubre La Comunidad Salesforce
Descubre La Comunidad SalesforceDescubre La Comunidad Salesforce
Descubre La Comunidad Salesforce
 
PCE-Salesforce1MobileApp
PCE-Salesforce1MobileAppPCE-Salesforce1MobileApp
PCE-Salesforce1MobileApp
 

Kürzlich hochgeladen

Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesPhilip Schwarz
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmSujith Sukumaran
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
Cyber security and its impact on E commerce
Cyber security and its impact on E commerceCyber security and its impact on E commerce
Cyber security and its impact on E commercemanigoyal112
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsAhmed Mohamed
 
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Mater
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)jennyeacort
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfAlina Yurenko
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Natan Silnitsky
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样umasea
 
Xen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfXen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfStefano Stabellini
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureDinusha Kumarasiri
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Matt Ray
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...Technogeeks
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Cizo Technology Services
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfFerryKemperman
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfMarharyta Nedzelska
 

Kürzlich hochgeladen (20)

Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a series
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalm
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
Cyber security and its impact on E commerce
Cyber security and its impact on E commerceCyber security and its impact on E commerce
Cyber security and its impact on E commerce
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
 
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
 
Advantages of Odoo ERP 17 for Your Business
Advantages of Odoo ERP 17 for Your BusinessAdvantages of Odoo ERP 17 for Your Business
Advantages of Odoo ERP 17 for Your Business
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
 
Xen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfXen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdf
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with Azure
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdf
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdf
 
2.pdf Ejercicios de programación competitiva
2.pdf Ejercicios de programación competitiva2.pdf Ejercicios de programación competitiva
2.pdf Ejercicios de programación competitiva
 

Apex Flex Queue: Batch Apex Liberated

  • 1. Apex Liberation Carolina Ruiz Medina Principal Developer in Product Innovation Team at FinancialForce.com @CarolEnLaNube
  • 2. Safe Harbor Safe harbor statement under the Private Securities Litigation Reform Act of 1995: This presentation may contain forward-looking statements that involve risks, uncertainties, and assumptions. If any such uncertainties materialize or if any of the assumptions proves incorrect, the results of salesforce.com, inc. could differ materially from the results expressed or implied by the forward-looking statements we make. All statements other than statements of historical fact could be deemed forward-looking, including any projections of product or service availability, subscriber growth, earnings, revenues, or other financial items and any statements regarding strategies or plans of management for future operations, statements of belief, any statements concerning new, planned, or upgraded services or technology developments and customer contracts or use of our services. The risks and uncertainties referred to above include – but are not limited to – risks associated with developing and delivering new functionality for our service, new products and services, our new business model, our past operating losses, possible fluctuations in our operating results and rate of growth, interruptions or delays in our Web hosting, breach of our security measures, the outcome of any litigation, risks associated with completed and any possible mergers and acquisitions, the immature market in which we operate, our relatively limited operating history, our ability to expand, retain, and motivate our employees and manage our growth, new releases of our service and successful customer deployment, our limited history reselling non-salesforce.com products, and utilization and selling to larger enterprise customers. Further information on potential factors that could affect the financial results of salesforce.com, inc. is included in our annual report on Form 10-K for the most recent fiscal year and in our quarterly report on Form 10-Q for the most recent fiscal quarter. These documents and others containing important disclosures are available on the SEC Filings section of the Investor Information section of our Web site. Any unreleased services or features referenced in this or other presentations, press releases or public statements are not currently available and may not be delivered on time or at all. Customers who purchase our services should make the purchase decisions based upon features that are currently available. Salesforce.com, inc. assumes no obligation and does not intend to update these forward-looking statements.
  • 3. Carolina Ruiz Medina Principal Developer in Product Innovation Team
  • 4. About FinancialForce.com • San Francisco Headquarters • Harrogate, UK • Granada, Spain • Toronto, Canada • Manchester, US • Opening Sydney, AUS in Sept, 2014 • 350+ Employees • 400+ by 12/31/2014 • Customers in 31 countries • 80% Y-o-Y revenue growth • Advent commitment of $50 million
  • 5. Before Asynchronous to process large amount of data • @Future • Batch Jobs • Schedule Jobs • Which options do we have? What is it?
  • 6. Before • The methods execute when Salesforce has available resources • @future only returns void type • No job ID for @future jobs • Parameters must be @Future primitive data types We can’t monitor the future jobs • Future methods must be static methods • The method does not necessarily execute in the same order is called
  • 7. Before public with sharing class FutureClass { @future static void myMethod(String a, Integer i) { System.debug('Method called with: ' + a + ' and ' + i+'... and I loved the sunny days :)'); // Perform long-running code } }
  • 8. Before: Batch Jobs Before • Database.executeBatch returns Id • We can monitor the batch jobs • We can’t order batch jobs • Only 5 active jobs are allow in the queue at the same time ( //show error ) • Interfaces that we can override in order to process data • Recursive calls • Possibility to use iterator – process different objet type in the same batch
  • 9. BBeefofroer: e public class UpdateAccountFields implements Database.Batchable<sObject>{ public final String Query; public final String Entity; public final String Field; public final String Value; public UpdateAccountFields(String q, String e, String f, String v){ Query=q; Entity=e; Field=f;Value=v; } public Database.QueryLocator start(Database.BatchableContext BC){ return Database.getQueryLocator(query); } public void execute(Database.BatchableContext BC, List<sObject> scope){ for(Sobject s : scope){s.put(Field,Value); } update scope; } public void finish(Database.BatchableContext BC){ } }
  • 10.
  • 11.
  • 12. and Now.. @Future F l e x Q u e u e Batch
  • 13. and Now.. Asynchronous • @Future • Batch Jobs : With FlexQue • Schedule Jobs • Queueable Interface
  • 14.
  • 15. Flex Queue More than 5 Apex Jobs More than 5 Apex Jobs in the Apex Jobs Table 5 Apex Jobs Processing + 95 Apex Jobs Holding New UI to monitor and manage the Apex Jobs in Holding Status Reorder the holding Apex Jobs Now
  • 16. Flex Queue More than 5 Apex Jobs More than 5 Apex Jobs in the Apex Jobs Table Now Show me!
  • 17. Flex Queue More than 5 Apex Jobs More than 5 Apex Jobs in the Apex Jobs Table 5 Apex Jobs Processing + 95 Apex Jobs Holding Now I don’t believe you, show that!
  • 18. Flex Queue More than 5 Apex Jobs More than 5 Apex Jobs in the Apex Jobs Table 5 Apex Jobs Processing + 95 Apex Jobs Holding New UI to monitor and manage the Apex Jobs in Holding Status Now Where is it? How does it work?!
  • 19. Flex Queue More than 5 Apex Jobs More than 5 Apex Jobs in the Apex Jobs Table 5 Apex Jobs Processing + 95 Apex Jobs Holding New UI to monitor and manage the Apex Jobs in Holding Status Reorder the holding Apex Jobs Now Lets reorder then!
  • 20. Flex Queue Then Maybe you are thinking now… • Schedule Jobs: do they work in the same way? Yes, everything continues exactly the same. The benefit is now we can schedule and run jobs that call apex jobs having the benefit of Flex Queue that allow us to set the Batch in Holding status • Can I reorder using any apex Method? • Can I abort the Holding Jobs by UI or using System.Abort?
  • 22. Taking Care!! With a big power became a big responsibility • Only re order when necessary • If there are batch jobs that are dependent to others! • If there are chaining batch jobs
  • 23. Extra public class AsyncExecutionExample implements Queueable { public void execute(QueueableContext context) { Account a = new Account(Name='Acme',Phone='(415) 555-1212'); insert a; } } Submit and Monitor Jobs for Asynchronous Execution with the Queueable Interface ID jobID = System.enqueueJob(new AsyncExecutionExample()); AsyncApexJob jobInfo = [SELECT Status,NumberOfErrors FROM AsyncApexJob WHERE Id=:jobID];
  • 25. Links • Josh Kaplan blog • Apex Developer guide • Winter ‘15 release notes
  • 26. Q&A as I always say… Easy questions please ☺ @CarolEnLaNube