Skip to content

Commit

Permalink
Crystalball fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
tijsrademakers committed Jul 22, 2014
1 parent 891a36b commit 820afc9
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public SimulationEvent apply(EventLogEntry event) {
localScope = true;
}
String taskDefinitionKeyValue = (String) data.get(Fields.TASK_DEFINITION_KEY);

Map<String, Object> properties = new HashMap<String, Object>();
properties.put("taskId", taskIdValue);
properties.put(TASK_DEFINITION_KEY, taskDefinitionKeyValue);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public void handle(SimulationEvent event) {
variableValueEquals(StartReplayLogEventHandler.PROCESS_INSTANCE_ID, processInstanceId).
variableValueEquals(StartReplayLogEventHandler.SIMULATION_RUN_ID, simulationRunId).
singleResult();

Task task = SimulationRunContext.getTaskService().createTaskQuery().
processInstanceId(processInstance.getId()).
taskDefinitionKey(taskDefinitionKey).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ protected Map<String, Object> handleCommonTaskFields(TaskEntity task) {
Map<String, Object> data = new HashMap<String, Object>();
putInMapIfNotNull(data, Fields.ID, task.getId());
putInMapIfNotNull(data, Fields.NAME, task.getName());
putInMapIfNotNull(data, Fields.TASK_DEFINITION_KEY, task.getTaskDefinitionKey());
putInMapIfNotNull(data, Fields.DESCRIPTION, task.getDescription());
putInMapIfNotNull(data, Fields.ASSIGNEE, task.getAssignee());
putInMapIfNotNull(data, Fields.OWNER, task.getOwner());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
import org.activiti.engine.history.HistoricProcessInstance;
import org.activiti.engine.impl.el.NoExecutionVariableScope;
import org.activiti.engine.repository.ProcessDefinition;
import org.activiti.engine.runtime.ProcessInstance;
import org.activiti.explorer.ExplorerApp;
import org.activiti.explorer.I18nManager;
import org.activiti.explorer.Messages;
Expand Down Expand Up @@ -407,21 +408,30 @@ protected void refreshEvents() {
protected void fillEventValues() {
for (SimulationEvent originalEvent : simulationEvents) {
boolean executed = true;
for (SimulationEvent event : SimulationRunContext.getEventCalendar().getEvents()) {
if (originalEvent.equals(event)) {
executed = false;
stepButton.setEnabled(true);
showProcessInstanceButton.setCaption(i18nManager.getMessage(
Messages.TASK_PART_OF_PROCESS, definitionMap.get(replayHistoricInstance.getProcessDefinitionId())));
showProcessInstanceButton.setVisible(true);
break;
if (SimulationRunContext.getEventCalendar() != null && SimulationRunContext.getEventCalendar().getEvents() != null) {
for (SimulationEvent event : SimulationRunContext.getEventCalendar().getEvents()) {
if (originalEvent.equals(event)) {
executed = false;
stepButton.setEnabled(true);
break;
}
}
}

Object itemId = eventTable.addItem();
eventTable.getItem(itemId).getItemProperty("type").setValue(originalEvent.getType());
eventTable.getItem(itemId).getItemProperty("executed").setValue(executed);
}

if (replayHistoricInstance != null && replayHistoricInstance.getId() != null) {
ProcessInstance testInstance = runtimeService.createProcessInstanceQuery().processInstanceId(replayHistoricInstance.getId()).singleResult();
if (testInstance != null) {
showProcessInstanceButton.setCaption(i18nManager.getMessage(
Messages.TASK_PART_OF_PROCESS, definitionMap.get(replayHistoricInstance.getProcessDefinitionId())));
showProcessInstanceButton.setVisible(true);
}
}

eventTable.setVisible(true);
}

Expand Down

0 comments on commit 820afc9

Please sign in to comment.