Post on 16-Jun-2015
description
WRITING MAGENTO EXTENSIONS FOR X.COMMERCE
June 2012
15/06/2012
x.commerce
What is x.commerce for?
15/06/2012 2
What is the Fabric?
15/06/2012 3
X.commerce Terminology
CapabilityTenantTokenTopicMessageContract
15/06/2012 4
What is a capability?
15/06/2012 5
Endpoint
The Fabric's Messaging Model
15/06/2012 6
Tenant
15/06/2012 7
Topic
/listing/create /order/update /marketplace/category/find /listing/created /marketplace/account/searchSucceeded
15/06/2012 8
Definition for Sending
A capability sends
a message
on a topic
on behalf of a tenant
15/06/2012 9
https://api.x.com/fabric/<topic>
Bearer token
Definition for Receiving
A capability receives
a message
on a topic
on behalf of a tenant
15/06/2012 10
https://<your endpoint>/<topic>
Tenant pseudonym
OCL Contract
15/06/2012 11
Hello Fabric
How to work with the Fabric
15/06/2012 12
X.commerce Developer Package in Action
15/06/2012 13
X.commerce Developer Package
15/06/2012 14
Message Relay Client
15/06/2012 15
Message Relay Client
15/06/2012 16
Local capability
Fabric
SBRSBC
LAN
NAT
New Fabric Based Extension
Sell On Ebay extension
15/06/2012 17
How to send a message
15/06/2012 18
How to receive a message
15/06/2012 19
Moving forward
Choreography
15/06/2012 20
Why Choreography?
15/06/2012 21
What properties are mandatory?How can data be hidden from a
listener?What do data differences mean?
Which messages are authoritative?
Is a reply is expected?
How long to wait for a reply?
How many times to retry?
When is an interaction finished?
How to implement a process?
What are my responsibilities?
Has a commitment been made?
Orchestration vs. Choreography
15/06/2012 22
A
B C
D
O21
34 5
67
8
Orchestration
A
B C
D
2134
5 6
Choreography
Overview of XOCL
15/06/2012 23
1. Packages
2. Contracts
3. Processes
4. Roles
5. Workflows
6. Transactions
7. Entities
8. Messages
XOCL Language Files
15/06/2012 24
File name Purpose
domain.Processes.xocl The abstract processes and concrete workflows of the capability.
domain.Transactions.xocl
The entities, their states, and the transactions (or actions) within the capability.
domain.Messages.xocl The data structures and types, as well as the messages of the capability.
domain.Contracts.xocl Defines contracts that may be implemented by a capability. Each contract contains a list of process roles that a contract implementation is responsible for.
domain.Version.xocl The package version and status of the XOCL files.
Packages
15/06/2012 25
Inventory Management (com.x.inventory.v1)
Product Information Management (com.x.pim.v1).
ProductTaxonomy (com.x.producttaxonomy.v1)
Marketplace (com.x.marketplace.v3)
OrderManagement (com.x.ordermanagement.v2)
The top-level containers for the data and logic of a given business domain.
Package defines the namespace and version
Contract
15/06/2012 26
Contract is a named set of roles
Each role plays a specific part in a specific business process.
Process Role
15/06/2012 27
Process roles are bound to transaction roles by workflows
Roles determine the message topics to which a capability publishes and subscribes.
Process
15/06/2012 28
A process is a distributed activity with a textual description and two or more roles
Workflow
15/06/2012 29
A workflow is a sequence of actions
A concrete implementation of a process.
Transaction
15/06/2012 30
An exchange of messages that leaves a process in a known state
Entity
15/06/2012 31
package com.x.ordermanagement.v2 {
import com.x.ordermanagement.v2.*
import com.x.customer.v1.*
entity Order {
state Submitted[Cancelled, Shipped]
state Shipped[Cancelled, Returned]
state Cancelled
state Returned
}
Representation of a shared state machine for a business object
Message
15/06/2012 32
/<workflow_package>/<workflow>/<message>
/com.x.inventory.v1/StockItemUpdate/UpdateStockItem
What is the Fabric?
A message bus Topic-oriented Multi-tenant Asynchronous Contract-driven Reinforced by new XOCL
Choreography
15/06/2012 33
Benefits of the Fabric?
Contract-drivenNew business opportunitiesNew capabilities – direct monetization
Easy to integrateNew area of expertise
15/06/2012 34
Writing Magento Extensions for X.Commerce
15/06/2012 35
Writing Magento Extensions for X.Commerce
15/06/2012 36
Спасибо Алексей Пильгуй
Magento, Киев
alexey.pilguy@magento.com