Home > Forum > General > Prevent task creations depending of environment

Prevent task creations depending of environment
0

Hi,

imagine a workflow with on start (cyclical) automation that starts the workflow itself. This can be a sync of an external data source with a dictionary. If the sync returns an error a step for error validation gets entered. Having this on dev, test and prod would then generate a task on all environments.

I expect to have a task creation only in production environment if the process already exists on prod. If the process only exists on test and dev I expect the task creation only on test. And if only on dev then the task on dev.

Have you already found a way how to prevent a task creation on the "lower" environments?

One first idea would having 3 MSSQL connections for all 3 environments. Then a MSSQL data source for each connection that gets process information, mainly the process GUID and then a business rule managing where this process GUID can be found across all environments. We have a global constant environment ID with breaked inheritance return 3 for dev, 2 for test and 1 for prod.

I'm looking forward to your (better) suggestions.

Kind regards
Sébastien

MVP

Hi Sébastien,


I have to admit, I don’t understand the issue.

In general a process should behave the same in each environment. If you sometimes want to have a task and sometimes not, you would need a flow control as intermediate steps always need a task.

If you don’t have separate environments for the external system or you need to use the same data, I don’t see why you wouldn’t want handle the issue in case of an expected error. If the error is causes due to outdated data and you don’t want to update it on dev/test, I would:
- Deactivate the global action/add a condition when the workflow should be started
- Activate deployment mode for the process to redirect all mails, if this is the annoying part.

Best regards,
Daniel

In reply to: Daniel Krüger (DCCS)

Hi Sébastien,


I have to admit, I don’t understand the issue.

In general a process should behave the same in each environment. If you sometimes want to have a task and sometimes not, you would need a flow control as intermediate steps always need a task.

If you don’t have separate environments for the external system or you need to use the same data, I don’t see why you wouldn’t want handle the issue in case of an expected error. If the error is causes due to outdated data and you don’t want to update it on dev/test, I would:
- Deactivate the global action/add a condition when the workflow should be started
- Activate deployment mode for the process to redirect all mails, if this is the annoying part.

Best regards,
Daniel

Hi Daniel,

thanks for your reply.

I'll try a better explanation:

We have a workflow that get's started every day. The workflow checks if all entries of a dictionary with organizational units have a user assigned from the HR division to the specific OU. If there is no assigned HR user an email gets sent (every day) to inform that an assignee is missing for the given OU(s). Later instead of an email there will be a task. Having this workflow on dev, test and prod generates always this email. On dev wie catch all emails to our dev mailbox. But on test and prod the mails get sent to the recipients.
I don't really like to disable the cycle on environments as there are other workflows not only checking a state but really doing a sync from external data to e.g. a dictionary. Moreover we have always to remind on export and import to switch on the cycle on the specific environment what is prone to errors. If any error occurs during a sync a task gets generated for the BPS devs to check the failure and document it with a comment before closing the task.
I want to prevent having this task on prod, dev and test. Having it on prod is the place I want it to have and to complete the task. Having the task also on test and dev gets annoying. If the workflow isn't deployed on prod yet but on test the task shall be created on test only but not on dev. And if its not deployed on prod and test too I want it only on dev.

- Deactivate the global action/add a condition when the workflow should be started
> The workflow needs to be started on all environments because of sync automations. So this is no option.
- Activate deployment mode for the process to redirect all mails, if this is the annoying part.
> The mails on test and prod must be sent to the specified recipients - but only from the "most deployed" workflow. So this is no option either.

I have now a Flow Control that checks if the current environment is equal to the "most deployed" environment of the workflow. If yes the path leads to an intermediate step for the creation of the task. If not the path directly leads to the negative end step. I've attached the WF model. The intermediate step for the BPS-Admin is the "Check failure reason" task and to document it with a required comment before going to the negative end step.

We have a global constant with breaking inheritance that returns 3 for dev, 2 for test and 1 for prod environment. The business rule checks if the process GUID also exists on test or even prod and returns the environment ID of test or even prod if the process GUID is found there.

I'm wondering if there is a better approach for doing this.

Kind regards
Sébastien