Skip to content

Commit

Permalink
update 02 to fix issue #1115
Browse files Browse the repository at this point in the history
  • Loading branch information
brunobuzzi committed Jun 13, 2020
1 parent dc2dd56 commit 262a21c
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ newBasedOn: aBpmProcessDefinition user: aBpmUser

^super new initialize
definition: aBpmProcessDefinition;
generateUniqueId;
creator: aBpmUser;
processName: aBpmProcessDefinition processName;
yourself
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,5 @@ Updating
definition: aBpmProcessDefinition
"The receiver set its definition with <aBpmProcessDefinition> and generate an unused id (see issue #1115).
If the <newId> exist then it generate a newone in a loop until an unused <id> is created"
| newId generator |

definition := aBpmProcessDefinition.

generator := Lag1MwcRandom new.
newId := generator integer.

[(definition getProcessInstanceWith: newId ifAbsent: []) notNil] whileTrue: [newId := generator integer]. "loop"

self id: newId
definition := aBpmProcessDefinition.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
unique id
generateUniqueId
"The receiver generate an unique ID.
See issue: #1115"
| generator newId |

generator := Lag1MwcRandom new.
newId := generator integer.

[(definition getProcessInstanceWith: newId ifAbsent: []) notNil] whileTrue: [newId := generator integer]. "loop"

self id: newId.

^newId
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"class" : {
"newBasedOn:user:" : "brunobb 01/31/2020 10:45" },
"newBasedOn:user:" : "brunobb 06/12/2020 14:26" },
"instance" : {
"abortProcess:" : "brunobb 01/31/2020 10:45",
"addActivityToPerform:" : "brunobb 01/31/2020 10:45",
Expand All @@ -27,7 +27,7 @@
"currentActivities:" : "brunobb 01/31/2020 10:45",
"currentState" : "brunobb 01/31/2020 10:45",
"definition" : "brunobb 01/31/2020 10:45",
"definition:" : "brunobb 02/27/2020 06:15",
"definition:" : "brunobb 06/12/2020 14:25",
"doesNotUnderstand:" : "brunobb 01/31/2020 10:45",
"endEvents" : "brunobb 01/31/2020 10:45",
"endEvents:" : "brunobb 01/31/2020 10:45",
Expand All @@ -51,6 +51,7 @@
"finalizedDate" : "brunobb 01/31/2020 10:45",
"generateNextTransitionsFrom:" : "brunobb 01/31/2020 11:24",
"generateProcessMapFor:" : "brunobb 01/31/2020 10:45",
"generateUniqueId" : "brunobb 06/12/2020 14:27",
"getActiveArtifacts" : "brunobb 01/31/2020 10:45",
"getAllActivitiesReversed" : "brunobb 01/31/2020 10:45",
"getAllArtifacts" : "brunobb 01/31/2020 10:45",
Expand Down
2 changes: 1 addition & 1 deletion repository/BpmRuntime.package/monticello.meta/version

Large diffs are not rendered by default.

0 comments on commit 262a21c

Please sign in to comment.