Lock one process

Kamila
New Contributor III

Hi Team,

We have 2 similar processes under one member in workflow. I need to lock process A, when B is completed. Could you please advise what method to use? 

Many thanks!

2 ACCEPTED SOLUTIONS

Krishna
Valued Contributor

@Kamila  - You can use the below method to lock. I am not sure what do you mean by Close ? What are you trying to close ?

BRApi.Workflow.Locking.LockWorkflowUnitDescendants(si, wfClusterPk, profileTypeFilter, workflowChannelKey)

 

 

 

Thanks
Krishna

View solution in original post

Krishna
Valued Contributor

@Kamila  - In that Case you have to use WF channel so the lock will be independent of each other then you can use the WF Event Handler to lock based on which WF profile has been selected by user.

Thanks
Krishna

View solution in original post

6 REPLIES 6

Krishna
Valued Contributor

@Kamila  - My understanding is that you have 2 Import Process under the WF and you would like to lock Process A when B is completed. If that is the case 

1. If you are not using WF channel and the process is manual load then you can lock B then A will automatically lock because it is using the same Standard WF channel.

2. If you are using WF channel & also automation you can perform this using Extender Business rule by load it to the cube once lock process B then Loca A as well.

 

 

Thanks
Krishna

Kamila
New Contributor III

Thank you Krishna for your reply!

Yes, I have 2 import processes under WF and I can't lock them manually each time. I wanted to use your (2) option to create a Extender BR, but I couldn't find any method to close specific process under workflow.

Krishna
Valued Contributor

@Kamila  - You can use the below method to lock. I am not sure what do you mean by Close ? What are you trying to close ?

BRApi.Workflow.Locking.LockWorkflowUnitDescendants(si, wfClusterPk, profileTypeFilter, workflowChannelKey)

 

 

 

Thanks
Krishna

Kamila
New Contributor III

I have 2 similar import processes within one workflow and unfortunately both should be enabled. When user decides to use process A, process B should be locked (and vice versa). The goal is to prevent completion of both processes. 

Krishna
Valued Contributor

@Kamila  - In that Case you have to use WF channel so the lock will be independent of each other then you can use the WF Event Handler to lock based on which WF profile has been selected by user.

Thanks
Krishna

Kamila
New Contributor III

This was very helpful, thank you Krishna 🙂