how can i get process initiator's city at start point

hello ,

have have one query .

in my process there is 2 task

task1 : service task
rask2 : human task

when user click on start process task 1 will be executed and then task 2 will assign that user .
i want to know how to get user’s city at human task using this code :

apiAccessor.getIdentityAPI().getUserWithProfessionalDetails(loggedUserId).getContactData().getCity();

but actully i want in task 1 : which is service task , how can i get this .
because in service task i have some opration in which this user’s city is needed as parameter . so can any one pl help me .

how to get user’s data and store into variable at starting task .

This is not the optimal way, but it should help you to get the idea (starting from your code):

apiAccessor.getIdentityAPI().getUserWithProfessionalDetails(BonitaUsers.getProcessInstanceInitiator(apiAccessor,processInstanceId).getId()).getContactData().getCity().toString();

Can you pl describe what is propre way to do it please