cancel
Showing results for 
Search instead for 
Did you mean: 

[SPA Build PA] - How to set the business key?

kai-raschke
Explorer
0 Kudos

Hi,

I am using SPA Build Process Automation and trying to set the businessKey attribute of an instance.
The metadata the API can access is kind of this

{
	"id": "2747e24d-7af2-11ed-a965-eeee0a8569dc",
	"subject": "TextInput",
	"businessKey": "2747e24d-7af2-11ed-a965-eeee0a8569dc",
	"completedAt": null
	...
}<br>

The business key is initialized with the internal process instance id.
But this does not reflect a handy way for process participants, customer or colleagues to refer to a specific instance (e.g. in support cases).

Workflow for CF had at least the possibility to access the meta data through {$.info} expression variables (but read-only).

What I tried so far:

1. Access and write the metadata/property

=> Not working, there is no access to metadata through SPA custom script function (irpa_core), neither write nor read in runtime.

2. Access and write the business key through API call (PATCH v1/workflow-instances/{instanceId}) - but only when I already know the instance ID.

=> API documentation says "Modifies the properties of a given workflow instance, for example [...]". But it seems it only supports changing the status an instance, no other property (at least not the businessKey) = HTTP 422 Error

Does someone know a different approach for changing the business key or has a different idea of dealing with a human-readable reference for process instances?

View Entire Topic
Archana
Product and Topic Expert
Product and Topic Expert

Hello Kai,

I want to take my earlier response back :). With SAP Build Process Automation, you can now set a business key to any value of the process start context which means coming either from trigger form or trigger API input fields. Later you can use them to search in Monitor application or Process VIsibility application.

kai-raschke
Explorer
0 Kudos

Thank you! That's exactly what I was looking for.

I did not notice that setting by now and haven't read about it the manual or any other search.

JuanDK78
Participant
0 Kudos

The business key mapping from a context does not seem to work if you start the workflow by and an API call.

If you have a Form trigger or a parent process, the business key is populated, but if I try to start the process with and API the business key is null.

See below in my api call I have tried everything I could think off.