Salesforce

Project Running Sequence (Magic xpi 4.14)

« Go Back

Information

 
Created BySalesforce Service User
Approval Process StatusPublished
Objective
Description

Project Running Sequence (Magic xpi 4.14)

The following steps describe the sequence of events that occur when your projects status is RUNNING.

  1. When the project is running, three elements operate simultaneously: workers, polling triggers, and external triggers. Each Magic xpi server can run one or more workers/triggers for a variety of tasks:

    1. A polling trigger (such as the Directory Scanner), also known as an asynchronous trigger, is a Magic xpi server thread that constantly checks external systems (such as an email account) to see whether it needs to invoke a flow without waiting for a response. When it needs to invoke a flow, it places a flow message with a status of READY_FOR_USE in the IMM .

    2. Each available worker scans the IMM for jobs to execute, meaning messages whose status is READY_FOR_USE. When the worker finds a message, it changes the status to IN_PROCESS, passes the message payload to the flow, and executes the flow logic. (This is known as a pull mechanism.)

To prevent two workers from executing the same message, the change of the status to IN_PROCESS is performed in a transaction so that only one worker will succeed.

  1. An external trigger, such as the HTTP Requester or a Web server, is an external application. Once the trigger receives a request, it places a message in the IMM that invokes the flow. The synchronous external triggers will also wait for a response message.

  1. When the main flow is completed, the worker updates the request message’s status in the IMM to DONE, and is then free to scan for additional messages.

  2. If the message is from a synchronic trigger (such as an HTTP trigger), when the flow ends, the worker writes a response message to the IMM , which the trigger will send to the client.

  3. Every parallel and stand-alone branch is also handled as a separate message written by the flow to the IMM . This new thread (the parallel or stand-alone branch) can be handled by any of the project's workers, even a worker running on a different machine.

For a visual explanation of how the server architecture works, click here.

Reference
Attachment 
Attachment