fferpcore.ProcessMessageglobal with sharing class ProcessMessage fferpcore.Message used for requests and responses in a two phase commit process. Properties
Methods
createTokenglobal static String createToken() Creates a new 36 character token for use in a new process. The token is derived from the current time and current user. This is has reasonable likelihood of being unique. forNewProcessglobal static fferpcore.ProcessMessage forNewProcess(Id recordId, String processToken, String replyTo) Creates a Process fferpcore.Message for a new process. Input Parameters
Return ValueThe generated ProcessMessage newCompleteMessageglobal static fferpcore.ProcessMessage newCompleteMessage(Id recordId, String processToken, Map<String, Object> userData) Creates a Process fferpcore.Message to signify that a process is complete. Input Parameters
Return ValueThe generated ProcessMessage fromMessageglobal static fferpcore.ProcessMessage fromMessage(Map<String, Object> messageBody) Deserializes a fferpcore.ProcessMessage from a message body that has already been deserialized using JSON.deserializeUntyped(). See DeliveredMessage.getDeserializedBody(). Input Parameters
Return ValueThe deserialized ProcessMessage. getMessageVersionglobal Integer getMessageVersion() Return ValueThe Process Message Version of this messsage. createReplyglobal fferpcore.ProcessMessage createReply(String responseState, String message) Creates a reply to the message with the state and message provided. Input Parameters
Return ValueThe generated ProcessMessage. getSubjectIdglobal Id getSubjectId() Return ValueThe ID of the record that is the subject of this process message. getProcessTokenglobal String getProcessToken() Return ValueThe token that identifies this attempt at the process. setStatusglobal void setStatus(String status) Input Parameters
setMessageglobal void setMessage(String message) Input Parameters
getDataglobal Map<String, Object> getData() Return ValueThe map of user data values that will be included with the message. getReplyToglobal String getReplyTo() Return ValueThe message type developer name on which the process initiator expects to receive replies. isCompleteglobal Boolean isComplete() Return ValueTrue of the process status is PROCES_STATE_COMPLETE isPendingglobal Boolean isPending() Return ValueTrue of the process status is PROCES_STATE_PENDING fferpcore.ProcessMessage.MessageDescriptionBuilderglobal inherited sharing class MessageDescriptionBuilder Builder of fferpcore.MessageDescription for a Process fferpcore.Message Publication. Methods
MessageDescriptionBuilderglobal MessageDescriptionBuilder(SObjectType objectType, SObjectField correlationField) Constructs a MessageDescriptionBuilder. Input Parameters
withReplyToMessageTypeglobal fferpcore.ProcessMessage.MessageDescriptionBuilder withReplyToMessageType(String replyTo) Specifies a value for the Process fferpcore.Message Reply To message key. Used by the initiator of the process. Input Parameters
Return ValueThis MessageDescriptionBuilder to support fluent coding style. withMessageVersionglobal fferpcore.ProcessMessage.MessageDescriptionBuilder withMessageVersion(Integer version) Specifies a value for the Process fferpcore.Message Version message key. Input Parameters
Return ValueThis MessageDescriptionBuilder to support fluent coding style. withHeaderFieldsglobal fferpcore.ProcessMessage.MessageDescriptionBuilder withHeaderFields(Map<String, fferpcore.MessageDescription.Node> fields) Specifies additional message description fields to include in the process message header. The fields are applied after the standard fields. As a result, standard fields can be overwritten. We recommend prefixing custom header fields with 'X-'. Input Parameters
Return ValueThis MessageDescriptionBuilder to support fluent coding style. withDataFieldsglobal fferpcore.ProcessMessage.MessageDescriptionBuilder withDataFields(Map<String, fferpcore.MessageDescription.Node> fields) Specifies additional message descripton fields to include in the data part of the process message. Input Parameters
Return ValueThis MessageDescriptionBuilder to support fluent coding style. buildglobal fferpcore.MessageDescription build() Constructs a fferpcore.MessageDescription based on the current state of the MessageDescriptionBuilder. fferpcore.ProcessMessage.ProcessMessageContextglobal inherited sharing class ProcessMessageContext extends Context.SObjectContext fferpcore.Message fferpcore.Context for the Process Message. This class extends fferpcore.Context.SObjectContext Methods
ProcessMessageContextglobal ProcessMessageContext() ProcessMessageContextglobal ProcessMessageContext(SObjectType subjectType) The default is for internal use only and is not recommended for use. Use the constructor that takes SObjectType as an argument instead. getClassglobal virtual override Type getClass() This method is provided to support serialization to Javascript. This method returns the class type of the associated context. Return ValueThis service returns a Type object. Sample Code//Note: This sample code is for demonstration purposes only. It is not intended for //use in a production environment, is not guaranteed against defects or errors, and //is in no way optimized or streamlined. fferpcore.Context.SObjectContext context = new fferpcore.Context.SObjectContext(ExampleObject__c.SObjectType); System.assertEquals(fferpcore.Context.SObjectContext.class, context.getClass()); getPotentialChildrenglobal virtual override List<fferpcore.Context.Source> getPotentialChildren() This method returns a complete list of the fields on this particular SObject that are in the form of a Context.Source. Return ValueThis service returns a list of Source objects. Sample Code//Note: This sample code is for demonstration purposes only. It is not intended for //use in a production environment, is not guaranteed against defects or errors, and //is in no way optimized or streamlined. /** * We will assume the following fields only on ExampleObject__c: * Name * Email__c * Phone__c * Address__c * In reality use this would return all standard Salesforce fields eg. CreatedById etc */ fferpcore.Context.SObjectContext context = new fferpcore.Context.SObjectContext(ExampleObject__c.SObjectType); List<fferpcore.Context.Source> returnValue = context.getPotentialChildren(); System.assertEquals(4, returnValue.size()); getSourceglobal virtual override fferpcore.Context.Source getSource(String key) This method looks up a source by using its key if that key is related to the current context. Input Parameters
Return ValueThis service returns a Source object. Sample Code//Note: This sample code is for demonstration purposes only. It is not intended for //use in a production environment, is not guaranteed against defects or errors, and //is in no way optimized or streamlined. /** * We will assume the following fields only on ExampleObject__c: * Name * Email__c * Phone__c * Address__c * In actual use this would return all standard Salesforce fields eg. CreatedById etc */ fferpcore.Context.SObjectContext context = new fferpcore.Context.SObjectContext(ExampleObject__c.SObjectType); fferpcore.Context.Source returnValue = context.getSource('Name'); System.assertEquals('Name', returnValue.getKey()); fferpcore.ProcessMessage.NewProcessMessageDataSourceglobal with sharing class NewProcessMessageDataSource extends SObjectByIdDataSource Data source for new processes. This generates process messages with a status of PREPARING and the process token provided. This class extends fferpcore.SObjectByIdDataSource Methods
NewProcessMessageDataSourceglobal NewProcessMessageDataSource(SObjectType objectType, Set<Id> recordIds, String processToken) Constructs a fferpcore.DataSource for a new process. Input Parameters
requireFieldglobal override void requireField(String key) Implementation of the requireField() method from DataSource. Input Parameters
runQueryglobal override Iterator<fferpcore.DataSource.Row> runQuery() Implementation of the runQuery() method from DataSource. fferpcore.ProcessMessage.ExistingProcessMessageDataSourceglobal with sharing class ExistingProcessMessageDataSource extends SObjectByIdDataSource Data source for existing processes. This generates process messages with the status, message and upstream data values from the messages parameter. This class extends fferpcore.SObjectByIdDataSource Methods
ExistingProcessMessageDataSourceglobal ExistingProcessMessageDataSource(SObjectType objectType, Map<Id, fferpcore.ProcessMessage> messages) Constructs an ExistingProcessMessageDataSource. Input Parameters
requireFieldglobal override void requireField(String key) Implementation of the requireField() method from DataSource. Input Parameters
runQueryglobal override Iterator<fferpcore.DataSource.Row> runQuery() Implementation of the runQuery() method from DataSource. |