Track Order Only Services
Some services need to be ordered and recorded, but do not require ongoing lifecycle management after fulfilment. In these cases, Activate supports order-only services that immediately end themselves, allowing the order to be tracked without leaving an active service instance behind.
This approach is commonly used for physical or consumable items where return, expiry, or revocation is not relevant, but audit and reporting of the order itself is still valuable.
Order-only services with immediate end behaviour
Order-only services are designed to trigger fulfilment without behaving like long-lived services. When configured correctly, the service instance is created for tracking purposes and then immediately ended as part of the order process.
This allows you to:
- Record that the service was ordered
- Run fulfilment processes as normal
- Avoid cluttering user records with inactive services
- Retain accurate reporting and audit history
When to use this approach
Use this pattern when:
- The service represents a one-off item
- There is no concept of return, expiry, or revocation
- The order itself must be auditable or reportable
- The service should not appear as active for the user
Common examples include:
- Mouse pads
- Peripherals
- Printed materials
- Welcome or starter items
How the behaviour works
When an order-only service is requested:
- The service order runs as normal
- The service instance is saved so the order can be tracked
- The service instance is immediately ended as part of the order process
From a configuration perspective, this happens entirely within the order process, without requiring the service to behave like a managed lifecycle service.
This behaviour applies only to order-only services. Standard services continue to follow their normal lifecycle rules.
Implementation overview
This pattern consists of:
- An order-only service
- An order process attached to that service
- A script in the order process that immediately ends the service instance after saving it
Service configuration
The service must be configured as order-only.
This ensures:
- The service does not remain active after fulfilment
- The lifecycle is controlled by the order process
- The service instance exists only for tracking and reporting
Order process configuration
Attach an order process to the service. This process is responsible for:
- Handling fulfilment
- Saving the service instance
- Ending the service instance immediately once recorded
The script below must be executed as part of this order process.
Order process script
The following script processes the services included in the order, saves any new order-only service instances, and immediately ends them. This script can be found at //Tasks/Services/Order/OrderOnlyScript out of the box
8.2 version
This version is for 8.2 and above
using System;
using System.Xml;
using Innovation.Activate;
class Script : ScriptBase
{
public void main()
{
ServiceInstanceCollection services = new ServiceInstanceCollection(null);
foreach (XmlElement n in Job.Arguments.SelectNodes("services/*"))
{
ServiceInstance srv = ServiceInstance.GetFromXml(n);
if (srv == null) continue;
if(srv.Id>0) continue; // Already created
if (srv.Status == ProvisioningObject.ProvisioningObjectStatus.Published && srv.Flags.HasFlag(ServiceInstance.ServiceFlags.OrderOnly))
{
srv.Status = ProvisioningObject.ProvisioningObjectStatus.Deleted;
srv.SetInfo();
XmlValue.Set(n, "id", srv.Id.ToString());
}
}
}
}
8.1 Version
This version applies to 8.1 and below.
using System;
using System.Xml;
using Innovation.Activate;
class Script : ScriptBase
{
public void main()
{
ServiceInstanceCollection services = new ServiceInstanceCollection(null);
foreach (XmlElement n in Job.Arguments.SelectNodes("services/*"))
{
ServiceInstance srv = ServiceInstance.GetFromXml(n);
if (srv == null) continue;
if(srv.Id>0) continue; // Already created
if (srv.Status == ProvisioningObject.ProvisioningObjectStatus.Published && srv.Flags.HasFlag(ServiceInstance.ServiceFlags.OrderOnly))
{
srv.SetInfo();
srv.Delete(Job, false);
XmlValue.Set(n, "id", srv.Id.ToString());
}
}
}
}
This script ensures that:
- The order is fully recorded
- The service instance does not remain active
- The order can be audited and reported on
Reporting behaviour
Although the service instance is immediately ended:
- The order is still visible in service history
- Reports can show when the service was ordered and by whom
- The service does not appear as active for the user
This makes the approach suitable for:
- Consumable or physical item reporting
- Audit trails
- Cost or chargeback reporting
Version notes
- In Activate 8.1, the recommended approach is to save the service instance and immediately end it in the order process
- In Activate 8.2 and later, order-only services also support being ended at creation time
For maximum compatibility, using the order-process script to end the service instance works consistently across versions.
Summary
Order-only services with immediate end behaviour allow you to:
- Trigger fulfilment workflows
- Maintain clean user service records
- Retain accurate order history
They are ideal for scenarios where tracking the order matters, but tracking the service lifecycle does not.