mirror of
https://github.com/sartography/spiff-arena.git
synced 2025-03-01 01:20:45 +00:00
Merge pull request #256 from sartography/feature/view_button
Feature/view button
This commit is contained in:
commit
9b61b22fb2
@ -388,9 +388,6 @@ def _render_instructions_for_end_user(task_model: TaskModel, extensions: Optiona
|
||||
|
||||
|
||||
def _interstitial_stream(process_instance: ProcessInstanceModel) -> Generator[str, Optional[str], None]:
|
||||
processor = ProcessInstanceProcessor(process_instance)
|
||||
reported_ids = [] # A list of all the ids reported by this endpoint so far.
|
||||
|
||||
def get_reportable_tasks() -> Any:
|
||||
return processor.bpmn_process_instance.get_tasks(
|
||||
TaskState.WAITING | TaskState.STARTED | TaskState.READY | TaskState.ERROR
|
||||
@ -406,6 +403,9 @@ def _interstitial_stream(process_instance: ProcessInstanceModel) -> Generator[st
|
||||
return_hash[return_type] = entity
|
||||
return f"data: {current_app.json.dumps(return_hash)} \n\n"
|
||||
|
||||
|
||||
processor = ProcessInstanceProcessor(process_instance)
|
||||
reported_ids = [] # A list of all the ids reported by this endpoint so far.
|
||||
tasks = get_reportable_tasks()
|
||||
while True:
|
||||
for spiff_task in tasks:
|
||||
@ -428,7 +428,7 @@ def _interstitial_stream(process_instance: ProcessInstanceModel) -> Generator[st
|
||||
# do not do any processing if the instance is not currently active
|
||||
if process_instance.status not in ProcessInstanceModel.active_statuses():
|
||||
yield render_data("unrunnable_instance", process_instance)
|
||||
break
|
||||
return
|
||||
try:
|
||||
processor.do_engine_steps(execution_strategy_name="one_at_a_time")
|
||||
processor.do_engine_steps(execution_strategy_name="run_until_user_message")
|
||||
|
@ -1597,22 +1597,26 @@ export default function ProcessInstanceListTable({
|
||||
}
|
||||
|
||||
let buttonText = 'View';
|
||||
let buttonKind = 'ghost';
|
||||
if (
|
||||
processInstance.status !== 'suspended' &&
|
||||
hasAccessToCompleteTask &&
|
||||
processInstance.task_id
|
||||
) {
|
||||
if (hasAccessToCompleteTask && processInstance.task_id) {
|
||||
buttonText = 'Go';
|
||||
buttonKind = 'secondary';
|
||||
}
|
||||
|
||||
buttonElement = (
|
||||
<Button kind={buttonKind} href={interstitialUrl}>
|
||||
<Button kind="secondary" href={interstitialUrl}>
|
||||
{buttonText}
|
||||
</Button>
|
||||
);
|
||||
currentRow.push(<td>{buttonElement}</td>);
|
||||
|
||||
if (
|
||||
processInstance.status === 'not_started' ||
|
||||
processInstance.status === 'user_input_required' ||
|
||||
processInstance.status === 'waiting' ||
|
||||
processInstance.status === 'complete'
|
||||
) {
|
||||
currentRow.push(<td>{buttonElement}</td>);
|
||||
} else {
|
||||
currentRow.push(<td />);
|
||||
}
|
||||
}
|
||||
|
||||
const rowStyle = { cursor: 'pointer' };
|
||||
|
Loading…
x
Reference in New Issue
Block a user