Managing Business Objects

The WorkflowService provides methods to create, update and delete business object instances.

Creating a new Business Object Instance

The following method creates a new business object instance in case it does not exist:

BusinessObject createBusinessObjectInstance(String qualifiedBusinessObjectId, Object initialValue);

The business object is created for the specified qualified Id of the business object with a given initial value. The initial value can also be null.

Usage:

org.eclipse.stardust.engine.api.runtime.WorkflowService service;

org.eclipse.stardust.engine.api.runtime.BusinessObject bo=service.createBusinessObjectInstance(qualifiedBusinessObjectId, initialValue)

This method requires execution permission modifyDataValues.

Updating the Value of a Business Object Instance

The following method updates the value of an existing business object instance having a specific qualified Id with a new given value.

BusinessObject updateBusinessObjectInstance(String qualifiedBusinessObjectId, Object newValue);

This method requires execution permission modifyDataValues.

Usage:

org.eclipse.stardust.engine.api.runtime.WorkflowService service;

org.eclipse.stardust.engine.api.runtime.BusinessObject bo=service.updateBusinessObjectInstance(qualifiedBusinessObjectId, newValue);

Deleting a Business Object Instance

To delete a business object instance with a specific qualified business object Id and the primary key identifying the instance, use the following method:

void deleteBusinessObjectInstance(String qualifiedBusinessObjectId, Object primaryKey);

This method also requires execution permission modifyDataValues.

Usage:

org.eclipse.stardust.engine.api.runtime.WorkflowService service;

service.deleteBusinessObjectInstance(qualifiedBusinessObjectId, primaryKey);