cancel
Showing results for 
Search instead for 
Did you mean: 

How to implement lists/multiple entries of one type within process context?

Former Member
0 Kudos

Hi all,

is it possible to save multiple data into the process context as a list?

I'm trying to create kind of a process log, that every activitiy can write a status message into a data object assign to the datatype defined by the following XSD:

...

<element name="ServiceRequestProcessLog" type="tns:ServiceRequestProcessLog"/>

<complexType name="ServiceRequestProcessLog">

<sequence>

<element name="Timestamp" type="dateTime"/>

<element name="ShortDescription" type="string"/>

<element name="LongDescription" type="string"/>

</sequence>

</complexType>

...

For sure, in that way i am able to fill these 3 fields from an activity.

But from the next the fields get overwritten of course.

How can i make an activity adding a new "Log Entry" into the context? Cardinality is not possible with complexType...

TIA

Michael

View Entire Topic
Former Member
0 Kudos

Hi Oliver,

interessting idea using sub-processes.

But at the moment i won't have any concurrency in my process so i guess i will prefer the mapping-activity-solution, even though thats not very nice aswell.

But i guess my plan to implement a process-status-tracking-functionality (which this issue is a part of) will fail anyway cause there is no proper way to access the process context from outside. See

Maybe both will be ready with the next EHP of CE?

Thank you profusely for your help!

Best regards

Michael

OliverGoetz
Employee
Employee
0 Kudos

Hi Michael,

I just got off the phone with a colleague from the mapping editor development, and he had a quite simple and elegant solution for the log append problem:

- Right-click on "Rules and Functions" in the Project Explorer tree and select "New Mapping Function..."

- Enter a name (e.g. 'CreateLogEntry')

- Select the LogEntry data type as return type.

- Add a parameter (with the add button) for each subelement you want to include in the log and select the appropriate type (like string for the descriptions or dateTime for the timestamp).

- Go to the "Mapping" pane and you will see a mapping editor that allows you to map the individual input parameters of the mapping function to the output fields of the LogEntry structure. (If you like you can assign the "current-dateTime()" function to the Timestamp in the output here and omit the timestamp input parameter altogether.)

- Click on the "Finish" button.

- Go to the Process model and in the output mapping of the activity assign the response of the activity to the logEntry subnode of the Log data object on the right-hand side. You will get an error marker complaining about incompatible types.

- Double-click on the logEntry node of the Log data object on the right-hand side to open the mapping editor and replace the entry in there with the call to the mapping function (e.g. 'CreateLogEntry("lala", "lalala")'); click "OK"

- Change the mapping assigment to "Append" by right-clicking on the mapping edge and selecting Assignment -> Append.

This should do the trick; if it doesn't work, please open a support ticket

Best regards,

Oliver