cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

SAP FSM. Business rule to unassign an activity. Reset the WF steps.

2,421

Hello.

I've created a BR which unassigns an activity if a technician pushes a button called "reject" which is actually a workflow step. That activates the BR and the activity is unassigned. The thing is that for my current project, it is required the new behavior regarding the activities, so no new activities should be created and cancel the old ones. I've configured the activity settings and marked a check in the action in the BR to avoid make a copy of an activity, in order to preserve the same activity ID.

So with this new behavior what happens is that when an activity is unassigned, it stays in that "reject" WF step and I'm not capable to create an "update object" action to reset the ServiceAssignmentStatus.

Please if anyone had this same issue or knows how to solve the problem, please help.

Thanks in advance.

Accepted Solutions (1)

Accepted Solutions (1)

Yanik_Kurzawski
Participant
0 Kudos

Hello Sergio,

as far as I know you can't completely reset the ServiceAssignmentStatus per business rule because you can't delete database entrys there. But you can change the workflow step (for example to 'new') per update Object so your service workflow is at its first step again.

With this when you assign the activity to a new technician, the technician can start from the beginning of the service workflow.

Greetings

Yanik

0 Kudos

Hello Yanik.

Thank you for your reply. It was very helpful. Now the BR executes correctly. Unfortunately, if I assign again that same activity, it will be on the step 'new', but it's not the same 'new' step in which you can see further steps, so you can't proceed with the work. But it's still a progress, thank you again.

Best regards.

Sergio.

Yanik_Kurzawski
Participant
0 Kudos

Hello Sergio,

did you check that your value in the business rule is the exact same as the name of the service workflow step? Because for me this scenario is working without problems.

So after first assigning the activity you get the following screen:

After clicking on reject in the app the business rule unassings the activity. Then after reassigning the same activity the workflow step is shown as "new" and I can proceed with work:

(Need to add another comment beacuase I can't add more screenshots here)

Greetins

Yanik

Yanik_Kurzawski
Participant
0 Kudos

On the timestamps you can see that this is the reassigned activity. So for me this is working just fine.

Greetings

Yanik

0 Kudos

Yes, I've checked if the name of the workflow step is the same and yes it is. And after assigning again the activity I've rejected previously, it's released on the step "new" just like in your screenshot, but I'm not able to proceed with travel ,work, or else. I've tried to update the activity's status also, but it didn't do anything.

Yanik_Kurzawski
Participant
0 Kudos

Hey Sergio,

I just tested a little bit more and found out its working fine on windows app for me but I also got the same problem as you when testing on android. On which app did you test this?

Greetings

Yanik

Yeah. I just wanted to write you the same. I've made a test on windows app, and it works. But on Android, it doesn't. I guess this is material for a good incident to SAP. Thank you very much Yanik. I'll post if SAP gave me any solution, just if you're interested.

Best regards.

Yanik_Kurzawski
Participant
0 Kudos

Yes I would be really interested about any provided solutions. Thanks in advance!

Best regards

Hello Yanik.

So we have a solution from SAP. Basically it consists in modifying the workflow steps (don't know how I didn't think about it). After the reject WF step, you have to add the ones which come after the "new" WF step, so when you assign the activity again, you'll see the first steps again. Nevertheless, if you assign a rejected activity, you'll see that the time was still running on the "reject" WF step, that's something that I don't like, because it seems that you can't reset the activity completely. Thank you for your help Yanik!

Best regards.

Sergio.

Answers (1)

Answers (1)

wendy_snyder
Advisor
Advisor
0 Kudos

Hi Sergio,

I tested my own unassign activity business rule and rejected an activity on my handheld device and I did not experience what you describe regardless of whether I marked the check in the action of the BR to avoid copies.

By any chance have you tested your scenario without using the business rule by just calling the unassign API endpoint via Postman

https://help.sap.com/docs/SAP_FIELD_SERVICE_MANAGEMENT/fsm_service_api/unassign-activity.html?q=serv...

The business rule unassign activity action basically calls this endpoint, so maybe this would be a good start to see if you have the same problem when you just execute the API endpoint outside of the business rule. This could help us narrow down if you have a problem with the business rule or if it is a problem with the API. If you are not able to test the API endpoint, maybe you could send me some more details about your rule, the configuration of your service workflow and the steps involved in executing this scenario.

Kind Regards,

Wendy

0 Kudos

Thank you for your help Wendy.