If you starting a workflow, based on a space, you obtained the current space id via navigator. Store this as variable into the processinstance. When you approve the worklfow(or reject) you have the already set variable in place.
Outcomes of transition being taked are available on task-leave events. After that, over workflowservice can those tasks retrieved and checked for this value(e.g. outcome="approved"). But if you have 2 tasks, the second task does not remember which decision being taked (if you have no delegation right there). Therefore you should store the outcome into the processinstance, using TaskController or via processdefinition "write, read" variables.
Once being set, you obtain the property via javascript as this is a normal property being transmitted to the next task(must be set on the second task as "readable").