Skip to content

Commit

Permalink
BZ-1057031 - Simulation: Unexpected result for process which contains…
Browse files Browse the repository at this point in the history
… Intermediate Events without name

(cherry picked from commit 99c2a67)
  • Loading branch information
mswiderski committed Jan 29, 2014
1 parent 7553241 commit e7d8949
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 8 deletions.
@@ -1,5 +1,6 @@
package org.jbpm.simulation.impl.events;

import org.apache.commons.lang.StringUtils;

public class ActivitySimulationEvent extends GenericSimulationEvent {

Expand All @@ -19,7 +20,11 @@ public ActivitySimulationEvent(String processId, long processInstanceId,


public String getActivityName() {
return this.activityName;
if (StringUtils.isNotEmpty(this.activityName)) {
return this.activityName;
}

return this.activityId;
}

public String getActivityId() {
Expand Down
@@ -1,5 +1,6 @@
package org.jbpm.simulation.impl.events;

import org.apache.commons.lang.StringUtils;
import org.jbpm.simulation.AggregatedSimulationEvent;


Expand Down Expand Up @@ -48,7 +49,11 @@ public void setMaxExecutionTime(double maxExecutionTime) {
this.maxExecutionTime = maxExecutionTime;
}
public String getActivityName() {
return activityName;
if (StringUtils.isNotEmpty(this.activityName)) {
return this.activityName;
}

return this.activityId;
}
public void setActivityName(String activityName) {
this.activityName = activityName;
Expand Down
@@ -1,5 +1,6 @@
package org.jbpm.simulation.impl.events;

import org.apache.commons.lang.StringUtils;
import org.jbpm.simulation.AggregatedSimulationEvent;

public class AggregatedEndEventSimulationEvent implements
Expand Down Expand Up @@ -56,7 +57,11 @@ public String getType() {


public String getActivityName() {
return activityName;
if (StringUtils.isNotEmpty(this.activityName)) {
return this.activityName;
}

return this.activityId;
}


Expand Down
Expand Up @@ -2,6 +2,8 @@

import java.util.Date;

import org.apache.commons.lang.StringUtils;

public class EndSimulationEvent extends GenericSimulationEvent {

private long processDuration;
Expand All @@ -22,7 +24,11 @@ public EndSimulationEvent(String processId, long processInstanceId, long startTi
}

public String getActivityName() {
return activityName;
if (StringUtils.isNotEmpty(this.activityName)) {
return this.activityName;
}

return this.activityId;
}

public void setActivityName(String activityName) {
Expand Down
Expand Up @@ -2,6 +2,8 @@

import java.util.Date;

import org.apache.commons.lang.StringUtils;

public class GatewaySimulationEvent extends GenericSimulationEvent {

private String activityName;
Expand All @@ -16,7 +18,11 @@ public GatewaySimulationEvent(String processId, long processInstanceId,
}

public String getActivityName() {
return activityName;
if (StringUtils.isNotEmpty(this.activityName)) {
return this.activityName;
}

return this.activityId;
}

public void setActivityName(String activityName) {
Expand Down
@@ -1,5 +1,7 @@
package org.jbpm.simulation.impl.events;

import org.apache.commons.lang.StringUtils;

public class HumanTaskActivitySimulationEvent extends GenericSimulationEvent {

private double resourceCost;
Expand Down Expand Up @@ -40,7 +42,11 @@ public void setWaitTime(long waitTime) {
}

public String getActivityName() {
return activityName;
if (StringUtils.isNotEmpty(this.activityName)) {
return this.activityName;
}

return this.activityId;
}

public void setActivityName(String activityName) {
Expand Down
Expand Up @@ -2,6 +2,7 @@

import java.util.Date;

import org.apache.commons.lang.StringUtils;

public class StartSimulationEvent extends GenericSimulationEvent {

Expand All @@ -16,7 +17,11 @@ public StartSimulationEvent(String processId, long processInstanceId, long start
}

public String getActivityName() {
return activityName;
if (StringUtils.isNotEmpty(this.activityName)) {
return this.activityName;
}

return this.activityId;
}

public void setActivityName(String activityName) {
Expand Down
Expand Up @@ -34,7 +34,7 @@ public void testBankLoanProcess() throws Exception {

List<AggregatedSimulationEvent> summary = (List<AggregatedSimulationEvent>) wmRepo.getGlobal("summary");
assertNotNull(summary);
assertEquals(10, summary.size());
assertEquals(11, summary.size());
assertEquals(110, wmRepo.getEvents().size());

wmRepo.close();
Expand Down

0 comments on commit e7d8949

Please sign in to comment.