-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add TriggerableJavaDelegate activity behavior to be able to control t…
…he leave from the delegate (#3949) Co-authored-by: Christopher Welsch <[email protected]>
- Loading branch information
1 parent
d10e822
commit ce05e65
Showing
25 changed files
with
1,212 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
...wable-engine/src/main/java/org/flowable/engine/impl/delegate/TriggerableJavaDelegate.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.flowable.engine.impl.delegate; | ||
|
||
import org.flowable.engine.delegate.DelegateExecution; | ||
|
||
/** | ||
* Similar to the {@link TriggerableActivityBehavior} but with a context that allows the implementing class | ||
* to decide if the execution should be left after the trigger or not | ||
* @author Christopher Welsch | ||
*/ | ||
public interface TriggerableJavaDelegate { | ||
|
||
void trigger(TriggerableJavaDelegate.Context context); | ||
|
||
interface Context { | ||
|
||
void doNotLeave(); | ||
|
||
Object getSignalData(); | ||
|
||
DelegateExecution getExecution(); | ||
|
||
String getSignalName(); | ||
} | ||
} |
67 changes: 67 additions & 0 deletions
67
...e/src/main/java/org/flowable/engine/impl/delegate/TriggerableJavaDelegateContextImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
/* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.flowable.engine.impl.delegate; | ||
|
||
import org.flowable.engine.delegate.DelegateExecution; | ||
|
||
/** | ||
* @author Christopher Welsch | ||
*/ | ||
public class TriggerableJavaDelegateContextImpl implements TriggerableJavaDelegate.Context { | ||
|
||
protected DelegateExecution execution; | ||
protected String signalName; | ||
protected Object signalData; | ||
|
||
protected boolean shouldLeave = true; | ||
|
||
public TriggerableJavaDelegateContextImpl(DelegateExecution execution, String signalName, Object signalData) { | ||
this.execution = execution; | ||
this.signalName = signalName; | ||
this.signalData = signalData; | ||
} | ||
@Override | ||
public DelegateExecution getExecution() { | ||
return execution; | ||
} | ||
|
||
public void setExecution(DelegateExecution execution) { | ||
this.execution = execution; | ||
} | ||
|
||
@Override | ||
public String getSignalName() { | ||
return signalName; | ||
} | ||
|
||
public void setSignalName(String signalName) { | ||
this.signalName = signalName; | ||
} | ||
@Override | ||
public Object getSignalData() { | ||
return signalData; | ||
} | ||
|
||
public void setSignalData(Object signalData) { | ||
this.signalData = signalData; | ||
} | ||
|
||
@Override | ||
public void doNotLeave() { | ||
shouldLeave = false; | ||
} | ||
|
||
public boolean shouldLeave() { | ||
return shouldLeave; | ||
} | ||
} |
Oops, something went wrong.