# WorkflowActivityContext (dapr-sdk-workflows 0.12.2 API)
declaration: package: io.dapr.workflows.runtime, class: WorkflowActivityContext

Package io.dapr.workflows.runtime

# Class WorkflowActivityContext

java.lang.Object
io.dapr.workflows.runtime.WorkflowActivityContext

All Implemented Interfaces:
  `com.microsoft.durabletask.TaskActivityContext`

public class WorkflowActivityContext extends Object implements com.microsoft.durabletask.TaskActivityContext
Wrapper for Durable Task Framework `TaskActivityContext`.

## Constructor Summary

Constructors
Constructor
Description
`WorkflowActivityContext(com.microsoft.durabletask.TaskActivityContext context)`
Constructor for WorkflowActivityContext.

## Method Summary

Modifier and Type
Method
Description
`<T> T`
`getInput(Class<T> targetType)`
Gets the input of the current activity.
`String`
`getName()`
Gets the name of the current activity.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### WorkflowActivityContext

public WorkflowActivityContext(com.microsoft.durabletask.TaskActivityContext context) throws IllegalArgumentException
Constructor for WorkflowActivityContext.

Parameters:
  `context` - TaskActivityContext
Throws:
  `IllegalArgumentException` - if context is null

## Method Details

### getName

public String getName()
Gets the name of the current activity.

Specified by:
  `getName` in interface `com.microsoft.durabletask.TaskActivityContext`
Returns:
  the name of the current activity

### getInput

public <T> T getInput(Class<T> targetType)
Gets the input of the current activity.

Specified by:
  `getInput` in interface `com.microsoft.durabletask.TaskActivityContext`
Type Parameters:
  `T` - the type of the input
Parameters:
  `targetType` - targetType of the input
Returns:
  the input of the current activity