Getting Started

../_images/vault_to_fusion_manage_and_back.png

If you are new to powerPLM, this page shows how to get started with the Fusion Manage cmdlets and how to use them in workflow jobs running on the Job Processor.

The same basic setup and usage also applies when using the cmdlets in customizations on workstations.

Prerequisites

Before using powerPLM, make sure:

  • You are signed in with a dedicated Autodesk ID on your Job Processor. By default, cloud operations are performed under this Autodesk system account. See the powerAPS Getting Started guide for details.

  • The Autodesk account is an active user in your Fusion Manage tenant.

    ../_images/fusion_manage_user_email.png

    Note: If powerPLM should act on behalf of the Autodesk ID of the user who submits the job, the same requirements apply to every Fusion Manage user whose Autodesk ID is used for impersonation.

  • Your Workspaces are configured as described in the Configuration in Fusion Manage chapter.



Whitelisting the Client ID for Fusion Manage

Before connecting to Fusion Manage, your system administrator must configure the following settings for your Fusion Manage tenant.

The default coolOrange app provides access to Fusion Manage and other Autodesk Platform Services (APS) endpoints.
To enable access to Fusion Manage, whitelist the app’s Client ID and enable concurrent sessions as described below:

  1. Log in to your Fusion Manage site as an admin.

  2. Click the burger menu on the top left and select Administration -> System Configuration.

  3. In the General Settings tab, under Security, enable the setting Allow concurrent sessions per user.

  4. Click Add new client ID and enter baEth24w4YXeBoGYvrdKTHlAi2HfvYtLabmmX0Hxwh047KuO in the Client ID field:

    ../_images/fusion_manage_add_clientid.png
  5. Enter a descriptive Description, e.g. coolOrange.

  6. Click Save.

Alternatively, if you require custom callback URLs or independent API request limits, you can create your own Autodesk app. The same whitelisting steps apply; simply use your own app’s Client ID instead of the coolOrange Client ID.

Start the PowerShell environment

To start scripting against Autodesk Fusion Manage, open any PowerShell IDE. The powerPLM module now provides cmdlets that allow you to interact with your tenant.
The module is generally imported automatically when you run one of its cmdlets.

Alternatively, you can open the powerPLM Console shortcut in the start menu, which executes Import-Module powerPLM for you.

Connect to your Fusion Manage tenant

Find your tenant’s name by copying the first part of the URL from your browser, after you sign in to your Fusion Manage Site.
For https://previewcoolorange.autodeskplm360.net/plm/mainDashboard the tenant name would be previewcoolorange.

Use Connect-FLC to authenticate with APS and connect to your Fusion Manage tenant:

#Authenticate with APS using your current Autodesk ID; outside of Job Processor a browser might open to complete the consent process
$connected = Connect-FLC -Tenant 'your_tenant_name'

For more information about Autodesk ID sign-in, browser consent, or passing custom App parameters, see the powerAPS Getting Started guide.

Get items from Fusion Manage

After connecting, you can use the Fusion Manage Cmdlets to work with items in your workspaces.

For example, retrieve all items from the Products workspace that are in the Concept workflow state and have a field named Number with the exact value 900-00010:

$items = Get-FLCItems -Workspace 'Products' -Filter 'workflowState=Concept AND ITEM_DETAILS:NUMBER="900-00010"'

Note

Get-FLCItems has this optional -Filter parameter that allows you to apply search criteria in the Fusion Manage format.

Update a field of an item

One of the previously retrieved items can now be easily updated with Update-FLCItem.
By navigating to the Workspace Manager in Fusion Manage we can find a Item Details Form that provides us a list of possible Item Details Fields that can be edited.

In following example we edit the value of a simple Text Field with the name ‘Description’ by just extending the value with a suffix.

$itemToUpdate = $items[0]

$itemToUpdate| Update-FLCItem -Properties @{'Description'= "$($itemToUpdate.Description) - Edited"}

After executing the Cmdlet, it will return an Item with the updated ‘Description’ Field.



Run Fusion Manage commands on the Job Processor

Once your script works interactively, you can run it automatically on the Job Processor.

The following example shows a simplified structure of a job script that connects to Fusion Manage using the dedicated Autodesk system account and updates an item.

Note

If you want the item in Fusion Manage to be updated under the name of the user who releases the Item in Vault and queues the job, you need to specify the -User parameter when connecting to Fusion Manage. That Autodesk ID must have granted APS consent beforehand on the Vault workstation.
See Connect-APS: Run APS calls on Job Processor, impersonating the Autodesk ID of user who submitted the job for details.

# JobEntityType = ITEM

Connect-FLC -Tenant 'your_tenant_name' -ErrorAction Stop

$items = Get-FLCItems -Workspace 'Products' -Filter ('workflowState=Concept AND ITEM_DETAILS:NUMBER="{0}"' -f $item._Number)

$itemToUpdate = $items[0]

$itemToUpdate| Update-FLCItem -Properties @{ 'Description'= "$($itemToUpdate.Description) - Edited by job for Vault Item $($item._Number)" }

#...

Save the script to the location %ProgramData%\coolOrange\powerJobs\Jobs\Sample.TransferItemBOMs.ps1.

GitHub

A full working version of this Sample.TransferItemBOMs job is available on GitHub.
It shows how Vault Item metadata, attached Vault files as well as Bill Of Material information can be transferred to Fusion 360 Manage.

Additional samples cover common scenarios and serve as a base to create custom workflows based on coolOrange powerJobs.

Before processing the job, start the powerJobs.exe at least once so that the new job type is automatically registered.
Click the Authorize APS Access button to open a browser window and grant consent to the default coolOrange app accessing your Fusion Manage tenant.

To queue the job, configure a Vault lifecycle state transition, for example using the powerJobs Settings Dialog:

../_images/vault_item_change_state.png ../_images/powerjobsprocessor_executing_job.png