Custom GAF (Guided Activity Floorplan) for C4C Utilities process
Any coding or configuration examples provided in this document are only examples and are NOT intended for use in a productive system. The example is only done to better explain and visualize the topic.
The objective of this blog is to show an example of how easily a Custom GAF can be created for Utilities Specific Process.
GAF (Guided Activity Floorplan) in C4C is the best way of representing a business process in guided manner. C4C SDK studio allows the creation of Custom GAF which can extend the capabilities standard process. C4C Utilities has it’s own reusable set of steps as Embedded Components (ECs) to make enhancement easier.
In this blog, we will create a Custom GAF (Guided Activity Floorplan) for Move In process (Utilities Move In Process) by making use of C4C SDK. For this we will be making use of all the standard steps of Utilities Move In Process with added custom step to enable Ticket creation with selected customer & Premise for Move In (You have to Save transaction at the end of Move In Process for ticket to get persisted).
Below will be our targeted GAF with the additional step called Ticket.
Overview of entire custom development scope : –
- Create a solution in PDI
- Create a Custom GAF
- Configure newly added GAF
- Create a Custom EC for Ticket Creation
- Implement Custom Action for Move In
- Add the Existing Reusable Embedded Components (EC) as Steps to the Newly Added GAF along with Custom Embedded Component (EC).
- Embed the Custom GAF to Premise TI
1. Creating a solution in PDI
Provide required information for the creation of Solution.
2. Create Custom GAF(Guided Activity Floorplan)
Now Let’s Create a Custom GAF where we can add reusable steps and custom steps.
To the newly created solution add new Item Guided Activity Floorplan (GAF).
Select the Utilities Action BO as the Business Object.
3. Configure new GAF
Open the GAF for Edit by selecting “Open in UI Designer” option.
3.1 Change the Floor plan title – The text provided will be appear as the GAF title.
3.2 Add additional steps – As by default there will be 3 steps, add additional steps using Navigation Items – Move in Process requires 4 steps in standard along with that we need one additional step for adding Custom EC. So add 2 more steps.
3.3 Configure each step – Properties like Title & Name. Name provided here is very important as this will be used for navigating between steps. Title provided at each step level will be that Step’s header.
3.4 Add an Inport for pass data into GAF – Add an Inport to the GAF which will have PremiseID as a parameter, this is how we can default a premise ID from where GAF is triggered. If your requirement is to default Customer, then you can have 2 parameters one for Premise ID and one for Customer.
One can pass any number of parameters which can be used to default the values.
3.5 Add Outports to GAF for pass data into Each Step – Outport is the way how a GAF can trigger a data transfer to embedded EC, so in our scenario as there are 5 ECs to which we must pass the data – add 5 separate outports. This will also enable GAF to have control over navigating to each step separately.
Refer the standard GAF “/BYD_COD/IndustrySolution/Utilities/UI/Extensibility/COD_UTILITIES_MOVE_IN_GAF.GAF.uicomponent” for Parameters.
3.5.1 Outport for Step1 (Premise & Customer selection step)
3.5.2 Outport for Step2 (Ticket creation step)
3.5.3 Outport for Step3 (Services selection step)
3.5.4 Outport for Step4(Contract Account & Payment related step)
3.5.5 Outport for Step5 (Move In Review)
3.6 Define Following Events for mentioned purpose –
3.6.1 EV_Cancel – This event will cancel the move in process by closing the GAF, this event must be set as “OnClick” event for “Cancel” Button, also “OnManualClose” in GAF floor plan.
3.6.2 EV_MoveIn – This event will be configured as “OnClick” for “Finish” button in GAF. In this event call the Custom Action which will be created for Move In process & Ticket Creation.
3.6.3 EV_Next – Forward navigation on Next Button Add a condition operation which will check the value of “/Root/UIState/ViewSwitchSelectedItem” which will allow set the same field for navigation.
Add Condition operation so that forward navigation happens by setting next value to the following data field “/Root/UIState/ViewSwitchSelectedItem”.
Setting the ViewSwitchSelectedItem as next Step “Name” property from navigation items.
3.6.4 EV_Previous – Backward navigation on Previous Button, add a condition operation which will check the value of “/Root/UIState/ViewSwitchSelectedItem” which will allow set the same field for navigation.
Add Condition operation so that backward navigation happens by setting previous value to the following “/Root/UIState/ViewSwitchSelectedItem”.
Setting the ViewSwitchSelectedItem as Previous Step “Name” property from navigation items.
3.6.5 EV_Sync – This will be first event which get called for this Custom GAF, for this to happen we must configure this event as a “OnFire” of already added inport. In this event we will first create a new instance of Utilities Action BO to Set a fresh Move In Context, to the same instance of Utilities Action BO we will be setting values which we got as a part of inport, in the current example we will be setting Premise ID.
Event Operations to be configured
- Add a BO Operation “Create”
- Data operation Premise ID to Contract Level MoveInServiceID
- SyncDataContainer
- FireOutport to Step1 – So that data transfer get triggered to first step.
Setting EV_Sync as OnFire event of the inport.
4. Implement Custom Action for Move In & Ticket Creation
We have to implement the Custom Action for Move In Process & Ticket creation.
4.1 Extend the BO Utilities Action BO
Enhance the BO with below changes
- Add a custom Action for Move In.
- Add a custom Action for Ticket Creation.
- Extension fields to store customer related info, Ticket creation indicator & Ticket description.
- message to display the move process is completed.
import AP.Common.GDT;
import AP.CRM.Global;
import AP.FO.BusinessPartner.Global;
[Extension] businessobject AP.CRM.Global:UtilitiesActionBo {
node Contract raises MoveInMsg {
message MoveInMsg text "Move In is SuccessFul";
action CustomMoveIn;
action CreateTicket;
[Transient][Label ("Customer Name")] element Ext_Customer_Name:LANGUAGEINDEPENDENT_EXTENDED_Text;
[Transient][Label ("Customer UUID")] element Ext_Customer_UUID:UUID;
[Transient][Label ("Ticket Description")] element Ext_TicketDesr:LANGUAGEINDEPENDENT_EXTENDED_Text;
[Transient][Label ("Ticket Creation Indicator")] element Ext_TicketCrIndicator:Indicator;
}
node Installation {
node MeterReading {
}
}
node CustomerDetails {
}
node ContractAccountDetails {
}
}
4.2 Implement the Move In Action – We can make use of Move In service exposed in ERP ISU or a custom ERP implementation.
4.3 Implement the Ticket Creation Action – This action when called will create a Ticket for the current customer against Premise decided to Move In (User has to make sure he/she has to Save after the GAF Process.
import ABSL;
import AP.Common.GDT;
import AP.FO.BusinessPartner.Global;
if(!this.Ext_TicketCrIndicator)
{
if(!this.MoveInServiceAddressID.IsInitial() && !this.CustomerUUID.content.IsInitial())
{
var premiseObj = UtilitiesPremise.Retrieve(this.MoveInServiceAddressID);
var customerObj = Customer.Retrieve(this.CustomerUUID);
if(premiseObj.IsSet() && customerObj.IsSet())
{
var ticket = ServiceRequest.Create();
// Setting the customer
if(!ticket.BuyerParty.IsSet())
{
ticket.BuyerParty.Create();
}
ticket.BuyerParty.PartyKey.PartyID.content = customerObj.InternalID;
// Setting Subject
ticket.Name.content = "Move In based Ticket";
// Setting Description
if(!ticket.IncidentDescriptionTextCollectionText.IsSet())
{
ticket.IncidentDescriptionTextCollectionText.Create();
}
if(!ticket.IncidentDescriptionTextCollectionText.TextContent.IsSet())
{
ticket.IncidentDescriptionTextCollectionText.TextContent.Create();
}
ticket.IncidentDescriptionTextCollectionText.TextContent.FormattedText.content = "Move In is required.";
// Associating Move In Premise to the Ticket.
if(!ticket.MainServiceReferenceObject.IsSet())
{
ticket.MainServiceReferenceObject.Create();
}
ticket.MainServiceReferenceObject.InstallationPointID.content = premiseObj.ToInstallPoint.ID.content;
// Setting Source.
ticket.DataOriginTypeCode = "8";
// Setting Priority.
if(!ticket.ServiceTerms.IsSet())
{
ticket.ServiceTerms.Create();
}
ticket.ServiceTerms.ServicePriorityCode = "1";
}
}
}
4.4 Associate the Custom Action on to the UI – Bind both CustomMoveIn & CreateTicket actions as respective operations of EV_MoveIn event.
Associate the EV_MoveIn as “OnClick” event for Finish button.
5. Create a Embedded Component (EC) on Utilities Action BO
By making use of new item window create a new EC where Customer offer can be displayed.
6. Add Reusable Steps (Embedded Components) to GAF
Add the existing reusable steps to GAF. All the reusable steps are part of following folder “/BYD_COD/IndustrySolution/Utilities/UI/Reuse”, by referring the standard Move In GAF “/BYD_COD/IndustrySolution/Utilities/UI/Extensibility/COD_UTILITIES_MOVE_IN_GAF.GAF.uicomponent”
- Step 1 – Premise & Customer Selection – /BYD_COD/IndustrySolution/Utilities/UI/Reuse/COD_UTILITIES_CUSTOMER_AND_PREMISE_SELECTION.EC.uicomponent
- Step 2 – Ticketing – Custom EC.
- Step 3 – Services – /BYD_COD/IndustrySolution/Utilities/UI/Reuse/COD_UTILITIES_SERVICES_AND_METER_READING_EC.EC.uicomponent
- Step 4 – Account Info – /BYD_COD/IndustrySolution/Utilities/UI/Reuse/COD_UTILITIES_ACCOUNT_AND_PAYMENT_DETAILS.EC.uicomponent
- Step 5 – Review – /BYD_COD/IndustrySolution/Utilities/UI/Reuse/COD_UTILITIES_MOVEIN_REVIEW.EC.uicomponent
We can drag and drop the reusable Embedded Component (EC) to each GAF step
7. Embed the Custom GAF to Premise TI
By adding a button to an EC and setting “Navigation” property you an achieve a simple navigation to the newly added GAF. By embedding this EC you can Launch the above custom GAF from any UI floor plans like Premise or Customer.
Completed GAF
Additional Step called Ticket
Hi John,
Thanks for your sharing, now I want to follow your step, at 3.4, I can't choose the inport ParameterBinding, something need to do at DataModel?
Best Regards,
Benny
Hi Benny,
Can you give me more insight on what you want to do?
In step 3.4 you might be trying to add an inport into your custom GAF, are you saying you are not able to do so ?
Regards,
John
Hi John,
Thanks a lot.
Maybe I miss something, the DataModel is empty in step 3.4.
So I can not add inport parameter, what is miss?
Best Regards,
Benny
Hi Benny,
You have to create a structure called InPortData By right clicking on the data model and add field called PremiseID.
Also you have to make sure you bind the data model to Utilities Action BO.
Below screen shot will give you the details of the required data model.
Regards,
John
Hi John,
Thanks for the detailed procedure.
Now, If I want to enable the GAF or Guided movein and moveout access to a user in C4C what I need to do?
Thanks in advance.
Regards,
Karthick M
I didn't get your question. Are you asking how to make it available in UI ?
Great topic John.
Thank you - Ramana
Hello John:
We would like to have sub-processes under main task (attached picture). For example, Process 1 may have sub tasks like 1.a, 1.b, 1.c. And also there will be dependency between subtasks; for example, if 1.a = Yes, 1.b will be skipped and the user will be taken to 1.c. (sample picture attached).
Can you share the framework behind this please. This feature is made available in SAP CRM Enhancement Pack 1. Please will you help on this topic please.
"Task based UI, which was introduced in CRM 7.0, improved with EHP1. The visual guidance of sub steps in an animated scrolling structure for complex tasks similar to the 1 to 5 steps structure that most users use to place an order online with a credit card. The tasks can be reused via embedding. "
Hi John,
Thanks for the great post.
I have a small question,
How do I hide the previous button at first step and the next button at last step?
I can see an Advanced option under Visibility in properties but it opens up an empty box and I am not sure what to write in there to achieve what I want.
Any help would be appreciated.
Regards,
Akash
Hi,
i have answered your original query.
https://answers.sap.com/questions/468313/sap-c4c-how-to-disable-the-previous-button-in-the.html?childToView=471866&answerPublished=true#
Regards,
John
Hi John,
Thanks for your helpful reply.
Regards,
Akash
Hello John Paul,
is it possible to add a Guided Activity Floorplan to an opportunity, too? Do you know any sample for that?
Greetings from Germany
Daniel
You can definitely make a custom GAF on any objects for any process flows. I don't know whether there are any sample references.
Okay. I'll give it a try. Thank you.
Hi John,
thank you very much for this post. Very helpfull.
John I did bind the GAF to the ‚New Button‘ of the OWL of the same Custom BO.
how can I make it that the ‚Edit-Button‘ also is bound to the GAF, better to the last Step of the GAF?
Can you describe me how to accomplish this?
Thanks in advance
Best regards
Erhan