Skip to content

package.py

Package (Node)

Package object to interact with Celonis Studio API.

url: str inherited property readonly

API

  • /package-manager/api/nodes/{node_id}

attachment_url: str inherited property readonly

API

  • /package-manager/api/attachments

package_nodes_url: str property readonly

API

  • /package-manager/api/nodes/by-root-id/{package_id}

viewer_attachments: CelonisCollection[Attachment] inherited property readonly

Get all Attachments of the Node with mode VIEWER.

Returns:

Type Description
CelonisCollection[Attachment]

A Collection of Attachments.

publish_url: str property readonly

API

  • /package-manager/api/packages/{package_key}/activate

creator_attachments: CelonisCollection[Attachment] inherited property readonly

Get all Attachments of the Node with mode CREATOR.

Returns:

Type Description
CelonisCollection[Attachment]

A Collection of Attachments.

variable_assignments_url: str property readonly

API

  • /package-manager/api/nodes/by-package-key/{package_key}/variables

attachments: CelonisCollection[Attachment] inherited property readonly

Get all Attachments of the Node.

Returns:

Type Description
CelonisCollection[Attachment]

A Collection of Attachments.

name: str inherited property writable

Name of the object via data['name'] if available.

draft_id: str property readonly

Get the Package Draft ID.

data inherited property writable

Response data from the Celonis API. If static is set to False, every time you set the data property will execute a POST request to the resource API endpoint to update the remote resource in Celonis EMS.

Examples:

o = celonis.<api-service>.find("<name or ID")

# This will execute a `POST` request to '<celonis_url>/<api-service>/api/...'
o.data["name"] = "New Name"

active_version property readonly

Get the current active version of the Package.

key: str inherited property writable

Key of the object via data['key'] if available.

content: Dict property writable

Get/Set the Package Content.

Returns:

Type Description
Dict

Serialized Content of the Package.

variables: List[Dict] property writable

Get/Set all Variables of the Package.

Returns:

Type Description
List[Dict]

All Variables of the Package.

variable_assignments: List[Dict] property readonly

Get all Variable Assignments of the Package.

API

  • GET: /package-manager/api/nodes/by-package-key/{package_key}/variables/values

Returns:

Type Description
List[Dict]

List of Variable Assignments.

history: List[Dict] property readonly

Get the Package History.

API

  • GET: /package-manager/api/packages/{package_id}/history

Returns:

Type Description
List[Dict]

List of dictionaries containing history of published versions and active versions.

nodes: CelonisCollection[BaseNode] property readonly

Get all Nodes of the Package.

Returns:

Type Description
CelonisCollection[BaseNode]

A Collection of Nodes of the Package.

knowledge_models: CelonisCollection[KnowledgeModel] property readonly

Get all Knowledge Models of the Package.

Returns:

Type Description
CelonisCollection[KnowledgeModel]

A Collection of Knowledge Models of the Package.

analyses: CelonisCollection[Analysis] property readonly

Get all Analysis of the Package.

Returns:

Type Description
CelonisCollection[Analysis]

A Collection of Analysis of the Package.

views: CelonisCollection[View] property readonly

Get all Views of the Package.

Returns:

Type Description
CelonisCollection[View]

A Collection of Views of the Package.

skills: CelonisCollection[Skill] property readonly

Get all Skills of the Package.

Returns:

Type Description
CelonisCollection[Skill]

A Collection of Skills of the Package.

folders: CelonisCollection[Folder] property readonly

Get all Folders of the Package.

Returns:

Type Description
CelonisCollection[Folder]

A Collection of Folders of the Package.

create_attachment(self, name, configuration, shareable=True, mode='CREATOR') inherited

Creates a new Attachment in the Node.

Parameters:

Name Type Description Default
name str

Name of attachment

required
configuration str

Dictionary with content of attachment

required
shareable bool

Whether attachment is shareable or not

True
mode str

Attachment mode. One of [VIEWER, CREATOR]

'CREATOR'

Returns:

Type Description
Attachment

The newly created Attachment.

reset_state(self) inherited

Resets data = None. This will force a reload of the remote resource from Celonis EMS on the next property access.

get_node_by_key(self, node_key)

Get a Node of the Package by Key.

API

  • GET: /package-manager/api/nodes/by-root-id/{package_id}

Parameters:

Name Type Description Default
node_key str

Key of the node.

required

Exceptions:

Type Description
PyCelonisNotFoundError

If Node was not found.

Returns:

Type Description
BaseNode

The specific Node by Key.

publish(self, version=None, node_ids_to_exclude=None)

Publishes current package using new version

Parameters

version : str, optional New version number following semantic versioning format (X.X.X). If left blank the currently active version number will be used and increased by one (until a nonexistent version number is found). node_ids_to_exclude : list of str List of ids of nodes that will be excluded from publishing

create_variable(self, name, value, variable_type='DATA_MODEL', description='')

Creates a new Variable in the Package and assigns the value to it.

API

  • POST: /package-manager/api/nodes/by-package-key/{package_key}/variables json { "key": name, "value": value, "type": variable_type, "description": description }

Parameters:

Name Type Description Default
name str

Name of the Variable.

required
value str

Value to be set for the Variable.

required
variable_type str

Type of the Variable. One of [DATA_MODEL, CONNECTION].

'DATA_MODEL'
description str

Description for the Variable.

''

Exceptions:

Type Description
PyCelonisValueError

If variable_type is invalid.

Returns:

Type Description
Dict

The newly created Variable.

create_knowledge_model(self, name, key=None, data_model_id='', data_model_variable='', kind='BASE', base_key=None)

Creates a new Knowledge Model in the Package.

API

  • POST: /semantic-layer/api/semantic-models json { "parentNodeId": self.id, "finalModelOptions": { "withVariableReplacement": True, "withAutogeneratedDataModelData": True }, # kind=EXTENSION "base": { "key": base_key, "version": base_km.parent.active_version } "content": { "kind": kind, "metadata": { "key": key or name, "displayName": name, }, "dataModelId": data_model_id or "{{data_model_variable}}", } }

Parameters:

Name Type Description Default
name str

Name of Knowledge Model.

required
key str

Key of Knowledge Model.

None
data_model_id str

ID of associated Datamodel (can't be set at the same time as data_model_variable).

''
data_model_variable str

Key associated with desired Datamodel.

''
kind str

Kind of Knowledge Model. One of [BASE, EXTENSION].

'BASE'
base_key str

Key of Base Knowledge Model. Only if kind=EXTENSION.

None

Exceptions:

Type Description
PyCelonisValueError

If both data_model_id and data_model_variable are set or none of them.

PyCelonisValueError

If kind is invalid.

PyCelonisValueError

If 'base_key' not set when kind=EXTENSION.

Returns:

Type Description
KnowledgeModel

The newly created Knowledge Model.

create_analysis(self, name, data_model_variable='', data_model_id='', key=None)

Creates a new Analysis in the Package.

API

  • POST: /process-analytics/analysis/v2/api/analysis json { "name": name, "key": key or name, "dataModelId": data_model_id, "knowledgeModelId": "", "rootNodeKey": self.name, "rootNodeId": self.id, "parentNodeKey": self.name, "parentNodeId": self.id, "rootWithKey": self.name, }

Parameters:

Name Type Description Default
name str

Name of the Analysis.

required
data_model_variable str

Key associated with the desired Datamodel.

''
data_model_id str

Uuid of the Datamodel.

''
key str

Key of the Analysis.

None

Exceptions:

Type Description
PyCelonisValueError

If both data_model_id and data_model_variable are set or none of them.

Returns:

Type Description
Analysis

The newly created Analysis.

delete(self)

Deletes the Package.

API

  • DELETE: /package-manager/api/packages/{self.id}
Back to top