I’ve implemented several external system integrations with Agile PLM recipe management, and here’s the comprehensive solution addressing all three focus areas:
1. Recipe Status Validation:
The API enforces strict status-based locking. Before any update, you must validate the current recipe status and workflow state. The key is understanding which statuses allow modifications in your configuration.
2. Java API Status Change Methods:
Implement a controlled status change workflow:
IRecipe recipe = (IRecipe) session.getObject(IRecipe.OBJECT_TYPE, recipeNum);
IStatus currentStatus = recipe.getStatus();
if (currentStatus.equals("Approved")) {
recipe.changeStatus("In_Modification");
recipe.setValue(RecipeConstants.ATT_NOTES, updatedNotes);
recipe.changeStatus("Approved");
}
3. Integration with External Systems:
For ERP integration, implement a queue-based update mechanism. Your external system should submit update requests to a staging table or message queue. A scheduled Agile PLM integration service processes these requests with proper status handling.
The critical insight is that you need to distinguish between attributes that require full change control (formulation quantities, ingredients) versus administrative attributes (notes, dates). Configure your recipe class to allow specific attributes to remain editable in approved status through Admin > Data Settings > Classes.
Alternatively, implement a custom privilege class that grants your integration service account permission to modify locked recipes. This requires careful security configuration but provides the cleanest API experience.
For your ERP integration specifically, I recommend creating a dedicated ‘System Update’ workflow path that allows automated modifications without full re-approval. This workflow should have accelerated approval routing or auto-approval for non-critical changes.
Implement robust error handling in your integration layer. When the API throws the locked formulation exception, your code should evaluate whether the update qualifies for the system update path or requires full change control. Log all attempts and outcomes for audit purposes.
One final consideration: ensure your external system timestamps are synchronized with Agile PLM. Status change operations can fail if there are timing conflicts or concurrent modification attempts.