There are some static methods which can be used within a process snippet to perform some context relevant functions, for e.g. processInstance() returns a ProcessInstanceData object of the  current process. processInstance().getStarter() returns process starter user id. There are some other methods, further information see here.