class Author(object): """Author ingestion workflow for HEPNames/Authors collection.""" name = "Author" data_type = "authors" workflow = [ # Make sure schema is set for proper indexing in Holding Pen set_schema, validate_record('authors'), IF_ELSE( is_marked('is-update'), SEND_UPDATE_NOTIFICATION, ASK_FOR_REVIEW + [ IF_ELSE( is_record_accepted, ( SEND_TO_LEGACY + NOTIFY_ACCEPTED + [ # TODO: once legacy is out, this should become # unconditional, and remove the SEND_TO_LEGACY # steps IF_NOT(in_production_mode, [store_record]), ] + CLOSE_TICKET_IF_NEEDED), NOTIFY_NOT_ACCEPTED), ], ), ]
class Article(object): """Article ingestion workflow for Literature collection.""" name = "HEP" data_type = "hep" workflow = ( [ # Make sure schema is set for proper indexing in Holding Pen set_schema, ] + ADD_MARKS + DELETE_AND_STOP_IF_NEEDED + ENHANCE_RECORD + # TODO: Once we have a way to resolve merges, we should # use that instead of stopping CHECK_IF_MERGE_AND_STOP_IF_SO + CHECK_IF_SUBMISSION_AND_ASK_FOR_APPROVAL + [ IF_ELSE( is_record_accepted, ( POSTENHANCE_RECORD + SEND_TO_LEGACY_AND_WAIT + NOTIFY_USER_OR_CURATOR + [ # TODO: once legacy is out, this should become # unconditional, and remove the SEND_TO_LEGACY_AND_WAIT # steps IF_NOT(in_production_mode, [store_record]), ]), NOTIFY_NOT_ACCEPTED, ), IF( is_submission, [close_ticket(ticket_id_key="ticket_id")], ) ])
NOTIFY_CURATOR_IF_NEEDED = [ IF_NOT( is_marked('is-update'), [ IF_ELSE( jlab_ticket_needed, do_not_repeat('create_ticket_jlab_curation')( create_ticket( template='literaturesuggest/tickets/curation_jlab.html', queue='HEP_curation_jlab', context_factory=curation_ticket_context, ticket_id_key='curation_ticket_id', ), ), IF( curation_ticket_needed, do_not_repeat('create_ticket_curator_core_curation')( create_ticket( template='literaturesuggest/tickets/curation_core.html', queue='HEP_curation', context_factory=curation_ticket_context, ticket_id_key='curation_ticket_id', ), ), ), ) ] ), ]
IF_NOT( is_marked('is-update'), [ IF_ELSE( jlab_ticket_needed, do_not_repeat('create_ticket_jlab_curation')(create_ticket( template='literaturesuggest/tickets/curation_jlab.html', queue='HEP_curation_jlab', context_factory=curation_ticket_context, ticket_id_key='curation_ticket_id', ), ), IF( curation_ticket_needed, # if core IF_ELSE( check_source_publishing, # if it is coming from publisher, create ticket in hep_publisher queue do_not_repeat('create_ticket_curator_core_publisher') (create_ticket( template= 'literaturesuggest/tickets/curation_core.html', queue='HEP_publishing', context_factory=curation_ticket_context, ticket_id_key='curation_ticket_id', ), ), # Otherwise create ticket in hep_curation queue do_not_repeat('create_ticket_curator_core_curation')( create_ticket( template= 'literaturesuggest/tickets/curation_core.html', queue='HEP_curation', context_factory=curation_ticket_context, ticket_id_key='curation_ticket_id', ), ), ), ), ) ]),
prepare_keywords, remove_references, ] SEND_TO_LEGACY = [ IF_ELSE(is_marked('is-update'), [ prepare_update_payload(extra_data_key="update_payload"), send_robotupload(mode="correct", extra_data_key="update_payload"), ], [ send_robotupload(mode="insert"), ]), ] WAIT_FOR_LEGACY_WEBCOLL = [ IF_NOT( is_marked('is-update'), wait_webcoll, ), ] STOP_IF_EXISTING_SUBMISSION = [ IF(is_submission, IF(is_marked('is-update'), NOTIFY_ALREADY_EXISTING)) ] HALT_FOR_APPROVAL = [ IF_ELSE( is_record_relevant, IF_ELSE( is_marked('auto-approved'), mark('approved', True), halt_record( action="hep_approval", message="Submission halted for curator approval.",