private function validate_steps($wf_info) { $error_messages = ""; $wf_info = json_decode($wf_info); $step_count = 0; // loop through all the steps if ($wf_info->steps) { foreach ($wf_info->steps as $step) { if ($step->fc_dbid == "nodefine") { // if fc_dbid is not defined, which means we have a missing step information $error_messages .= __("Missing \"", "oasisworkflow"); $error_messages .= $step->fc_label; $error_messages .= __("\" step information. Right click on the step to edit step information.", "oasisworkflow"); $error_messages .= "<br>"; // add new line for new messages to append on new line } // end if $step_count++; } // end for } // end if if ($step_count == 0) { $error_messages .= __("No steps found.", "oasisworkflow"); $error_messages .= "<br>"; // add new line for new messages to append on new line } $workflow_service = new OW_Workflow_Service(); $steps = $workflow_service->get_first_and_last_steps($wf_info); if ($steps != "nodefine" && count($steps["first"]) == 0 && count($steps["last"]) == 0) { $error_messages .= __("The workflow doesn't have a valid exit path.\tItems in this workflow will never exit the workflow. Please provide a valid exit path.", "oasisworkflow"); $error_messages .= "<br>"; // add new line for new messages to append on new line } if (count($wf_info->first_step) > 1) { $error_messages .= __('Multiple steps marked as first step. Workflow can have only one starting point.', "oasisworkflow"); $error_messages .= "<br>"; // add new line for new messages to append on new line } if (count($wf_info->first_step) == 0) { $error_messages .= __('Starting step not found. Workflow should have a starting point.', "oasisworkflow"); $error_messages .= "<br>"; // add new line for new messages to append on new line } return $error_messages; }